aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Ludd <solar@gentoo.org>2006-10-18 21:57:44 +0000
committerNed Ludd <solar@gentoo.org>2006-10-18 21:57:44 +0000
commite2d0b1dc9b1c6d35e944fc5a2f9698e6ae98c819 (patch)
tree5159008b83737a3cabe3e72acba1ecf1c6420d8c /pspax.c
parent- fix -u/-g 0 a little (diff)
downloadpax-utils-e2d0b1dc9b1c6d35e944fc5a2f9698e6ae98c819.tar.gz
pax-utils-e2d0b1dc9b1c6d35e944fc5a2f9698e6ae98c819.tar.bz2
pax-utils-e2d0b1dc9b1c6d35e944fc5a2f9698e6ae98c819.zip
- update README to add homepage, VCS info etc..
Diffstat (limited to 'pspax.c')
-rw-r--r--pspax.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/pspax.c b/pspax.c
index be60338..0ac3792 100644
--- a/pspax.c
+++ b/pspax.c
@@ -25,7 +25,7 @@
#endif
#define PROC_DIR "/proc"
-static const char *rcsid = "$Id: pspax.c,v 1.33 2006/10/05 00:21:15 solar Exp $";
+static const char *rcsid = "$Id: pspax.c,v 1.34 2006/10/18 21:57:44 solar Exp $";
#define argv0 "pspax"
@@ -442,13 +442,13 @@ static void parseargs(int argc, char *argv[])
case 'w': noexec = 0; writeexec = 1; break;
case 'v': verbose++; break;
case 'u':
- show_uid = atoi(optarg);
- if (show_uid == 0 && (strcmp(optarg, "0") != 0)) {
- pwd = getpwnam(optarg);
- if (pwd)
- show_uid = pwd->pw_uid;
- else
- err("unknown uid");
+ if ((pwd = getpwnam(optarg)) != NULL)
+ show_uid = pwd->pw_uid;
+ else {
+ errno = 0;
+ show_uid = strtol(optarg, NULL, 10);
+ if (show_uid == 0 && errno != 0)
+ err("invalid value");
}
break;
case 'g':