Magellan Linux

Diff of /trunk/mkinitrd-magellan/busybox/coreutils/length.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 532 by niro, Sat Sep 1 22:45:15 2007 UTC revision 816 by niro, Fri Apr 24 18:33:46 2009 UTC
# Line 2  Line 2 
2    
3  /* BB_AUDIT SUSv3 N/A -- Apparently a busybox (obsolete?) extension. */  /* BB_AUDIT SUSv3 N/A -- Apparently a busybox (obsolete?) extension. */
4    
5  #include <stdlib.h>  #include "libbb.h"
 #include <string.h>  
 #include <stdio.h>  
 #include "busybox.h"  
6    
7    /* This is a NOFORK applet. Be very careful! */
8    
9    int length_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
10  int length_main(int argc, char **argv)  int length_main(int argc, char **argv)
11  {  {
12   if ((argc != 2) ||  (**(++argv) == '-')) {   if ((argc != 2) || (**(++argv) == '-')) {
13      bb_show_usage();   bb_show_usage();
14   }   }
15    
16   printf("%lu\n", (unsigned long)strlen(*argv));   printf("%u\n", (unsigned)strlen(*argv));
17    
18   fflush_stdout_and_exit(EXIT_SUCCESS);   return fflush(stdout);
19  }  }

Legend:
Removed from v.532  
changed lines
  Added in v.816