]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
confile_utils: apply strprint() 2367/head
authorDonghwa Jeong <dh48.jeong@samsung.com>
Thu, 31 May 2018 11:39:46 +0000 (20:39 +0900)
committerDonghwa Jeong <dh48.jeong@samsung.com>
Thu, 31 May 2018 11:39:46 +0000 (20:39 +0900)
Signed-off-by: Donghwa Jeong <dh48.jeong@samsung.com>
src/lxc/confile_utils.c

index 30fec0583a32e3cacdbffe80ada770ef20ceb5cc..5686c60e9ca4851f4bf54ebdb7fb7d2821869de9 100644 (file)
@@ -635,32 +635,47 @@ int lxc_get_conf_str(char *retv, int inlen, const char *value)
 
 int lxc_get_conf_int(struct lxc_conf *c, char *retv, int inlen, int v)
 {
+       int len;
+       int fulllen = 0;
+
        if (!retv)
                inlen = 0;
        else
                memset(retv, 0, inlen);
 
-       return snprintf(retv, inlen, "%d", v);
+       strprint(retv, inlen, "%d", v);
+
+       return fulllen;
 }
 
 int lxc_get_conf_size_t(struct lxc_conf *c, char *retv, int inlen, size_t v)
 {
+       int len;
+       int fulllen = 0;
+
        if (!retv)
                inlen = 0;
        else
                memset(retv, 0, inlen);
 
-       return snprintf(retv, inlen, "%zu", v);
+       strprint(retv, inlen, "%zu", v);
+
+       return fulllen;
 }
 
 int lxc_get_conf_uint64(struct lxc_conf *c, char *retv, int inlen, uint64_t v)
 {
+       int len;
+       int fulllen = 0;
+
        if (!retv)
                inlen = 0;
        else
                memset(retv, 0, inlen);
 
-       return snprintf(retv, inlen, "%"PRIu64, v);
+       strprint(retv, inlen, "%"PRIu64, v);
+
+       return fulllen;
 }
 
 bool parse_limit_value(const char **value, rlim_t *res)