diff options
author | Stef Walter <stef@memberwebs.com> | 2004-08-17 23:25:09 +0000 |
---|---|---|
committer | Stef Walter <stef@memberwebs.com> | 2004-08-17 23:25:09 +0000 |
commit | 9ec2b8a00df375fc2481655e141a21912113deef (patch) | |
tree | 3c81089e30e5cb41e0c1ce2802198f4aec740bc2 /tools/mkha1.c | |
parent | 8a78d61361180445eb316f8738751cc6d845799b (diff) |
Remove new lines properly
Diffstat (limited to 'tools/mkha1.c')
-rw-r--r-- | tools/mkha1.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/mkha1.c b/tools/mkha1.c index 3124e48..5ac3fd3 100644 --- a/tools/mkha1.c +++ b/tools/mkha1.c @@ -100,6 +100,12 @@ static char* check_value(ha_buffer_t* buf, char* value, const char* name) printf("%s: ", name); fgets(t, 256, stdin); value = t; + + t = value + strlen(value); + + /* Remove any new lines from end */ + while(t > value && (*(t - 1) == '\n' || *(t - 1) == '\r')) + *(--t) = 0; } if(value[0] == 0) |