From: Klas Lindfors Date: Mon, 15 Apr 2013 07:17:03 +0000 (+0200) Subject: return amount of data X-Git-Tag: v1.13.0~40 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bf7d8b5dd702af7c9b66feebb82fc36e0e301877;p=yubikey-personalization return amount of data --- diff --git a/ykpers-json.c b/ykpers-json.c index dc5c569..c9d7a9c 100644 --- a/ykpers-json.c +++ b/ykpers-json.c @@ -161,7 +161,7 @@ int ykp_json_export_cfg(const YKP_CONFIG *cfg, char *json, size_t len) { /* free the root object, will free all children */ json_object_put(jobj); - return 0; + return strlen(json); } int ykp_json_import_cfg(const char *json, size_t len, YKP_CONFIG *cfg) { diff --git a/ykpers.c b/ykpers.c index 61fc16b..fe884e5 100644 --- a/ykpers.c +++ b/ykpers.c @@ -989,7 +989,7 @@ static int ykp_legacy_export_config(const YKP_CONFIG *cfg, char *buf, size_t len } pos += snprintf(buf + pos, len - (size_t)pos, "%s%s%s\n", str_extended_flags, str_key_value_separator, buffer); - return 1; + return pos; } return 0; }