Test for argv to be terminated

This commit is contained in:
Pierre Pronchery 2019-04-16 00:03:34 +02:00
parent d00b0840d5
commit 234de67376

View File

@ -21,6 +21,8 @@ int main(int argc, char * argv[])
printf("Command line:");
for(i = 0; i < argc; i++)
printf(" %s%s", argv[i], (i + 1 == argc) ? "\n" : "");
if(argv[i] != NULL)
puts("argv is not terminated properly!");
if((t = time(NULL)) == -1)
printf("Could not get the current time (%d)\n", errno);
else