aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-04-19 15:31:01 +0000
committerRoy Marples <roy@marples.name>2007-04-19 15:31:01 +0000
commit49b8b30ab7e35d8ad3cbe295eba3a93ba21a3509 (patch)
tree8fb9a379d9c40163391ad64a2e9a89636fee1200
parent2569e85579bc5c7d676865b386398119f04a5912 (diff)
Fix fstabinfo -p /
-rw-r--r--src/fstabinfo.c49
-rw-r--r--src/librc-misc.c2
2 files changed, 26 insertions, 25 deletions
diff --git a/src/fstabinfo.c b/src/fstabinfo.c
index ab437e08..7ab5b599 100644
--- a/src/fstabinfo.c
+++ b/src/fstabinfo.c
@@ -111,32 +111,33 @@ int main (int argc, char **argv)
break;
case 'p':
- switch (optarg[0]) {
- case '=':
- case '<':
- case '>':
- if (sscanf (optarg + 1, "%d", &n) != 1)
- eerrorx ("%s: invalid passno %s", argv[0], optarg + 1);
-
- while ((ent = GET_ENT)) {
- if (((optarg[0] == '=' && n == ENT_PASS (ent)) ||
- (optarg[0] == '<' && n > ENT_PASS (ent)) ||
- (optarg[0] == '>' && n < ENT_PASS (ent))) &&
- strcmp (ENT_FILE (ent), "none") != 0)
- {
- printf ("%s\n", ENT_FILE (ent));
+ switch (optarg[0]) {
+ case '=':
+ case '<':
+ case '>':
+ if (sscanf (optarg + 1, "%d", &n) != 1)
+ eerrorx ("%s: invalid passno %s", argv[0], optarg + 1);
+
+ while ((ent = GET_ENT)) {
+ if (((optarg[0] == '=' && n == ENT_PASS (ent)) ||
+ (optarg[0] == '<' && n > ENT_PASS (ent)) ||
+ (optarg[0] == '>' && n < ENT_PASS (ent))) &&
+ strcmp (ENT_FILE (ent), "none") != 0)
+ {
+ printf ("%s\n", ENT_FILE (ent));
+ result = EXIT_SUCCESS;
+ }
+ }
+ break;
+
+ default:
+ if ((ent = GET_ENT_FILE (optarg))) {
+ printf ("%d\n", ENT_PASS (ent));
result = EXIT_SUCCESS;
}
- }
- break;
-
- default:
- if ((ent = GET_ENT_FILE (optarg))) {
- printf ("%d\n", ENT_PASS (ent));
- result = EXIT_SUCCESS;
- }
- break;
- }
+ break;
+ }
+ break;
case 'h':
END_ENT;
diff --git a/src/librc-misc.c b/src/librc-misc.c
index 62000fa3..0700863e 100644
--- a/src/librc-misc.c
+++ b/src/librc-misc.c
@@ -59,7 +59,7 @@ char *rc_xstrdup (const char *str)
if (! str)
return (NULL);
- value = rc_xstrdup (str);
+ value = strdup (str);
if (value)
return (value);