From 3a62d45767dca76f109425fb8e641741a87ee4b4 Mon Sep 17 00:00:00 2001 From: M.Gergő Date: Wed, 13 May 2020 19:51:39 +0200 Subject: INI example --- src/ini_read.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') 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 -- cgit v1.2.3