diff options
author | Rob Landley <rob@landley.net> | 2020-02-25 11:49:49 -0600 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2020-02-25 11:49:49 -0600 |
commit | 1934fddf3eb3a4336d270cc6e7d5cbffe0667c78 (patch) | |
tree | baf161e1a41f7244d3c9b377aaa075f8f3abe4d6 | |
parent | d227e4aab673364ca9f35fa8ff0e0477385f97f7 (diff) | |
download | toybox-1934fddf3eb3a4336d270cc6e7d5cbffe0667c78.tar.gz |
Fix off by one error that treats bit 31 as negative (so ls --color sets
all the bits).
While we're at it, make LL be ULL so bit 63 doesn't have the same problem.
-rw-r--r-- | scripts/mkflags.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/mkflags.c b/scripts/mkflags.c index 76827e0f..fff9dd4c 100644 --- a/scripts/mkflags.c +++ b/scripts/mkflags.c @@ -162,7 +162,7 @@ int main(int argc, char *argv[]) if (!(out = outbuf)) return 1; printf("#undef FORCED_FLAG\n#undef FORCED_FLAGLL\n" - "#ifdef FORCE_FLAGS\n#define FORCED_FLAG 1\n#define FORCED_FLAGLL 1LL\n" + "#ifdef FORCE_FLAGS\n#define FORCED_FLAG 1\n#define FORCED_FLAGLL 1ULL\n" "#else\n#define FORCED_FLAG 0\n#define FORCED_FLAGLL 0\n#endif\n\n"); for (;;) { @@ -220,7 +220,7 @@ int main(int argc, char *argv[]) out += strlen(out); while (aflist) { - char *llstr = bit>31 ? "LL" : "", *s = (char []){0, 0, 0, 0}; + char *llstr = bit>30 ? "LL" : "", *s = (char []){0, 0, 0, 0}; int enabled = 0; // Output flag macro for bare longopts |