Changeset 5721
- Timestamp:
- Apr 29, 2008, 3:36:14 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/daemon/misc.c
r5715 r5721 28 28 #include <errno.h> 29 29 #include <fcntl.h> 30 #include <libgen.h> /* basename */ 30 31 #include <stdlib.h> 31 32 #include <stdio.h> … … 45 46 setmyname( const char * argv0 ) 46 47 { 47 const char * name; 48 49 name = strrchr( argv0, '/' ); 50 if( NULL == name || '\0' == *(++name) ) 51 { 52 name = argv0; 53 } 54 strlcpy( gl_myname, name, sizeof gl_myname ); 48 char tmp[MAX_PATH_LENGTH]; 49 strlcpy( tmp, argv0, sizeof( tmp ) ); 50 strlcpy( gl_myname, basename( tmp ), sizeof( gl_myname ) ); 55 51 } 56 52
Note: See TracChangeset
for help on using the changeset viewer.