Avoid Atoi to avoid int convertion

This commit is contained in:
nemunaire 2018-12-01 16:15:28 +01:00
commit 0f48b27a04
11 changed files with 32 additions and 39 deletions

View file

@ -30,14 +30,14 @@ func treatSubmission(pathname string, team fic.Team, exercice_id string) {
log.Println(id, "New submission receive", pathname)
// Parse exercice_id argument
eid, err := strconv.Atoi(exercice_id)
eid, err := strconv.ParseInt(exercice_id, 10, 64)
if err != nil {
log.Printf("%s [ERR] %s is not a valid number: %s\n", id, exercice_id, err)
return
}
// Find the given exercice
exercice, err := fic.GetExercice(int64(eid))
exercice, err := fic.GetExercice(eid)
if err != nil {
log.Printf("%s [ERR] Unable to find exercice %d: %s\n", id, eid, err)
return