-
- ret = Dispense_Give(sock, gsTextArgs[1], atoi(gsTextArgs[2]), gsTextArgs[3]);
+
+ char *tmp = NULL;
+ int amt = strtol(gsTextArgs[2], &tmp, 10);
+ if( !tmp || *tmp != '\0' ) {
+ fprintf(stderr, "dispense give: Balance is invalid, must be decimal number of cents");
+ return RV_ARGUMENTS;
+ }
+ ret = Dispense_Give(sock, gsTextArgs[1], amt, gsTextArgs[3]);