diff options
author | M.Gergő | 2020-05-13 19:51:39 +0200 |
---|---|---|
committer | M.Gergő | 2020-05-13 19:51:39 +0200 |
commit | 3a62d45767dca76f109425fb8e641741a87ee4b4 (patch) | |
tree | 3dea0a40c471945fdd57c5479b9069d9772eccec /src/ini_read.c | |
parent | 802157d15c9d0adc37621c4f32ed8083dcaf8303 (diff) | |
download | lightconfini-3a62d45767dca76f109425fb8e641741a87ee4b4.tar.gz lightconfini-3a62d45767dca76f109425fb8e641741a87ee4b4.zip |
INI example
Diffstat (limited to 'src/ini_read.c')
-rw-r--r-- | src/ini_read.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ini_read.c b/src/ini_read.c index 40774a3..28b7e18 100644 --- a/src/ini_read.c +++ b/src/ini_read.c @@ -41,11 +41,13 @@ char *strResize(char *ptr, size_t oldsize, size_t newsize){ } else if(ptr == NULL) { return tmp; } else if(newsize > oldsize) { // FEL - strncpy(tmp, ptr, oldsize); // old < new + //strncpy(tmp, ptr, oldsize); // old < new + snprintf(tmp, newsize, "%s", ptr); free(ptr); return tmp; } else if(newsize < oldsize){ //LE - strncpy(tmp, ptr, newsize); // new < old + //strncpy(tmp, ptr, newsize); // new < old + snprintf(tmp, newsize, "%s", ptr); free(ptr); return tmp; } else { //Ide sosem jutunk |