summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ascii2map.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/ascii2map.c b/ascii2map.c
index 298f742..30a2c44 100644
--- a/ascii2map.c
+++ b/ascii2map.c
@@ -201,6 +201,8 @@ int main(int argc, char *argv[])
char line[1024];
int f;
int in_map = 0;
+ size_t len = 0;
+ int warned = 0;
f = 1;
@@ -302,6 +304,19 @@ int main(int argc, char *argv[])
{
char *p;
+ if (len == 0)
+ {
+ len = strlen(line);
+ }
+ else
+ {
+ if (!warned && len != strlen(line))
+ {
+ fprintf(stderr, "WARNING: Lines of different length\n");
+ warned = 1;
+ }
+ }
+
p = line;
while(*p)