]> err.no Git - yubikey-personalization/commitdiff
return amount of data
authorKlas Lindfors <klas@yubico.com>
Mon, 15 Apr 2013 07:17:03 +0000 (09:17 +0200)
committerKlas Lindfors <klas@yubico.com>
Mon, 15 Apr 2013 07:17:03 +0000 (09:17 +0200)
ykpers-json.c
ykpers.c

index dc5c569d53f21023263c0030139e24c4c9c5a809..c9d7a9c1e1097a57e576dac400e4025181e2e6ae 100644 (file)
@@ -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) {
index 61fc16b61e51f270707df0e112c1465d4bc06f04..fe884e5369861066f788ee5dfab542b7c60238ee 100644 (file)
--- 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;
 }