aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Ludd <solar@gentoo.org>2006-10-18 22:00:17 +0000
committerNed Ludd <solar@gentoo.org>2006-10-18 22:00:17 +0000
commitcf92946c604cf8d3cbb1fde26488557d2addf5eb (patch)
treeea5a4f82d40665d691d86fe6871f10d6b610b787 /pspax.c
parent- update README to add homepage, VCS info etc.. (diff)
downloadpax-utils-cf92946c604cf8d3cbb1fde26488557d2addf5eb.tar.gz
pax-utils-cf92946c604cf8d3cbb1fde26488557d2addf5eb.tar.bz2
pax-utils-cf92946c604cf8d3cbb1fde26488557d2addf5eb.zip
- reverse testing strol pspax patch
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 0ac3792..11471ed 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.34 2006/10/18 21:57:44 solar Exp $";
+static const char *rcsid = "$Id: pspax.c,v 1.35 2006/10/18 22:00:17 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':
- 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");
+ 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");
}
break;
case 'g':