summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ini/ini_comment.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/ini/ini_comment.c b/ini/ini_comment.c
index 2b83ec5..ea9ff5e 100644
--- a/ini/ini_comment.c
+++ b/ini/ini_comment.c
@@ -300,18 +300,23 @@ static int ini_comment_modify(struct ini_comment *ic,
if (length == 0) input_len = strlen(input);
else input_len = length;
+ error = simplebuffer_add_str(elem,
+ input,
+ input_len,
+ INI_COMMENT_LEN);
+ }
+ else {
+ error = simplebuffer_add_str(elem,
+ "",
+ 0,
+ INI_COMMENT_LEN);
}
- error = simplebuffer_add_str(elem,
- input,
- input_len,
- INI_COMMENT_LEN);
if (error) {
TRACE_ERROR_NUMBER("Allocate buffer for the comment", error);
simplebuffer_free(elem);
return error;
}
-
}
/* Do action depending on mode */