diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-06-28 02:31:07 +0400 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-06-28 02:31:07 +0400 |
commit | b75fe798bb26fbf16a3251decd72bc20b44a00c5 (patch) | |
tree | cc11b07df97c84c6fb90c8c6913726b8dd25eec6 /coreutils/stat.c | |
parent | ce02b157beff1a8031595364c2fb654034e608b5 (diff) |
stat: pointers are not 0L, they are NULL
man: better error handling
Diffstat (limited to 'coreutils/stat.c')
-rw-r--r-- | coreutils/stat.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/coreutils/stat.c b/coreutils/stat.c index b2b1913a9..c34c06acb 100644 --- a/coreutils/stat.c +++ b/coreutils/stat.c @@ -240,14 +240,14 @@ static void print_stat(char *pformat, const char m, } else if (m == 'U') { setpwent(); pw_ent = getpwuid(statbuf->st_uid); - printfs(pformat, (pw_ent != 0L) ? pw_ent->pw_name : "UNKNOWN"); + printfs(pformat, (pw_ent != NULL) ? pw_ent->pw_name : "UNKNOWN"); } else if (m == 'g') { strcat(pformat, "lu"); printf(pformat, (unsigned long) statbuf->st_gid); } else if (m == 'G') { setgrent(); gw_ent = getgrgid(statbuf->st_gid); - printfs(pformat, (gw_ent != 0L) ? gw_ent->gr_name : "UNKNOWN"); + printfs(pformat, (gw_ent != NULL) ? gw_ent->gr_name : "UNKNOWN"); } else if (m == 't') { strcat(pformat, "lx"); printf(pformat, (unsigned long) major(statbuf->st_rdev)); @@ -609,9 +609,9 @@ static bool do_stat(const char *filename, const char *format) (unsigned long) (statbuf.st_mode & (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO)), bb_mode_string(statbuf.st_mode), (unsigned long) statbuf.st_uid, - (pw_ent != 0L) ? pw_ent->pw_name : "UNKNOWN", + (pw_ent != NULL) ? pw_ent->pw_name : "UNKNOWN", (unsigned long) statbuf.st_gid, - (gw_ent != 0L) ? gw_ent->gr_name : "UNKNOWN"); + (gw_ent != NULL) ? gw_ent->gr_name : "UNKNOWN"); #if ENABLE_SELINUX printf(" S_Context: %lc\n", *scontext); #endif |