sleep: don't just crash on missing arg

This commit is contained in:
K. Lange 2020-12-16 10:15:03 +09:00
parent f38a61f6c4
commit 545425ce36

View File

@ -13,6 +13,11 @@
int main(int argc, char ** argv) { int main(int argc, char ** argv) {
int ret = 0; int ret = 0;
if (argc < 2) {
fprintf(stderr, "%s: missing operand\n", argv[0]);
return 1;
}
char * arg = strdup(argv[1]); char * arg = strdup(argv[1]);
float time = atof(arg); float time = atof(arg);