Em 4/6/2013 17:29, Peter escreveu: > There's a dozen ways to pass NULL argv[i]'s to exec. The code must check > each argv[i], including argv[0], for NULL and print something other than > argv[i] in that case. See man execve(2) for a simple way to create lots a= nd > lots of NULL argv[i]s. > > -- Peter The initialization code calls main with argc containing the number of argument strings it parsed from the command line and filled argv with pointers to said strings. Argc will always be one or more because argv will contain at least a pointer to the string with the path and name of the executable file. If argc is n you can access up to argv[n-1], unless there is a bug in the c library's initialization code. Isaac --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .