Avoid Atoi to avoid int convertion

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

View file

@ -20,7 +20,7 @@ func SubmissionHandler(w http.ResponseWriter, r *http.Request, team string, sURL
}
// Check exercice validity then save the submission
if pex, err := strconv.Atoi(sURL[0]); err != nil {
if pex, err := strconv.ParseInt(sURL[0], 10, 64); err != nil {
http.Error(w, "{\"errmsg\":\"Requête invalide.\"}", http.StatusBadRequest)
return
} else if exercice := fmt.Sprintf("%d", pex); len(exercice) < 1 {