aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorM.Gergő2020-05-13 19:51:39 +0200
committerM.Gergő2020-05-13 19:51:39 +0200
commit3a62d45767dca76f109425fb8e641741a87ee4b4 (patch)
tree3dea0a40c471945fdd57c5479b9069d9772eccec /src
parent802157d15c9d0adc37621c4f32ed8083dcaf8303 (diff)
downloadlightconfini-3a62d45767dca76f109425fb8e641741a87ee4b4.tar.gz
lightconfini-3a62d45767dca76f109425fb8e641741a87ee4b4.zip
INI example
Diffstat (limited to 'src')
-rw-r--r--src/ini_read.c6
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