diff options
author | Eduardo Chappa <chappa@washington.edu> | 2018-05-13 01:38:56 -0600 |
---|---|---|
committer | Eduardo Chappa <chappa@washington.edu> | 2018-05-13 01:38:56 -0600 |
commit | aac7b10863bcfabe936feb5151e7e11123e13306 (patch) | |
tree | 8033a31daed6c94fcbdd41eef1682ba0539cfabd /pith/string.c | |
parent | 400647dcc1b040f82d22d539fc013f5e23132049 (diff) | |
download | alpine-aac7b10863bcfabe936feb5151e7e11123e13306.tar.xz |
* More changes to make Valgrind happy. Work in progress.
Diffstat (limited to 'pith/string.c')
-rw-r--r-- | pith/string.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/pith/string.c b/pith/string.c index 0c158fb8..11a57fc0 100644 --- a/pith/string.c +++ b/pith/string.c @@ -2917,8 +2917,8 @@ free_strlist(STRLIST_S **strp) void convert_decimal_to_roman (char *rn, size_t len, long n, char l) { - char symbols[7]; - int amo[7]; + char symbols[8]; + int amo[8]; int i, j, k; rn[0] = '\0'; @@ -2932,6 +2932,7 @@ convert_decimal_to_roman (char *rn, size_t len, long n, char l) symbols[4] = l + 'x' - 'i'; symbols[5] = l + 'v' - 'i'; symbols[6] = l; + symbols[7] = '\0'; amo[0] = n/1000; n -= amo[0]*1000; amo[1] = n/500; n -= amo[1]*500; @@ -2940,6 +2941,7 @@ convert_decimal_to_roman (char *rn, size_t len, long n, char l) amo[4] = n/10; n -= amo[4]*10; amo[5] = n/5; n -= amo[5]*5; amo[6] = n; + amo[7] = 0; /* make valgrind happy */ for(i = 0, j = 0; i < len && j < strlen(symbols); j++){ if(amo[j] < 4){ |