---
expand.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --dropbox a/expand.c b/expand.c
index 2449a8e..35b7a9a 100644
--- a/expand.c
+++ b/expand.c
_AT_@ -28,6 +28,8 @@ main(int argc, char *argv[])
break;
case 't':
spacestop = estrtol(EARGF(usage()), 0);
+ if (!spacestop)
+ eprintf("space size cannot be zero\n");
break;
default:
usage();
_AT_@ -66,7 +68,7 @@ expand(const char *file, FILE *fp, int spacestop)
do {
col++;
putchar(' ');
- } while (col & (spacestop - 1));
+ } while (col % spacestop);
} else {
putchar('\t');
col += spacestop - col % spacestop;
--
2.1.3
Received on Thu Dec 04 2014 - 23:04:48 CET
This archive was generated by hypermail 2.3.0 : Thu Dec 04 2014 - 23:12:07 CET