56,6 → 56,7 |
This is INCOMPATIBLE with calculating software : only suitable for REPRESENTATION of (money) numbers |
If env. variable w_use_comma is not set or not "1" , the behaviour is a number with a decimal point |
|
5/2019 use "strlcpy, strlcat" - size-bounded string copying and concatenation |
*/ |
|
#include <stdio.h> |
112,7 → 113,7 |
while( ptr != NULL){ |
if( cnt > MAX_CONV ){fprintf(stdout,"ERROR too many (> %d)conversion \n",MAX_CONV);exit(0);} |
/* next item in input argv[1] */ |
strncpy( word, ptr, MAX_DIGITS); |
strlcpy( word, ptr, sizeof(word)); |
length = strlen(ptr); |
if(length > MAX_DIGITS-1){fprintf(stdout,"ERROR string too large\n");exit(0);} |
/* reset counters */ |