X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Ffs%2Ffs_uri.c;h=0c2d64caca85186b4c5247e039e62ac935c994e1;hb=04630c5e40fc4de16393894d0b5ff2ca9055f4e2;hp=50c8785b6623c7fb241021fcf6adc41288146826;hpb=6003b6e317a1c41a9955a9c54f2fbd4fa2a854e8;p=oweals%2Fgnunet.git diff --git a/src/fs/fs_uri.c b/src/fs/fs_uri.c index 50c8785b6..0c2d64cac 100644 --- a/src/fs/fs_uri.c +++ b/src/fs/fs_uri.c @@ -214,7 +214,7 @@ percent_decode_keyword (const char *in, char **emsg) { if (out[rpos] == '%') { - if (1 != sscanf (&out[rpos + 1], "%2X", &hx)) + if (1 != SSCANF (&out[rpos + 1], "%2X", &hx)) { GNUNET_free (out); *emsg = GNUNET_strdup (_("`%' must be followed by HEX number")); @@ -1378,14 +1378,16 @@ GNUNET_FS_uri_sks_to_string_fancy (struct GNUNET_CONFIGURATION_Handle *cfg, { char *ret; char *name; + char *unique_name; if (uri->type != sks) return NULL; - name = GNUNET_PSEUDONYM_id_to_name (cfg, &uri->data.sks.namespace); - if (name == NULL) - return GNUNET_FS_uri_to_string (uri); - GNUNET_asprintf (&ret, "%s: %s", name, uri->data.sks.identifier); + (void) GNUNET_PSEUDONYM_get_info (cfg, &uri->data.sks.namespace, + NULL, NULL, &name, NULL); + unique_name = GNUNET_PSEUDONYM_name_uniquify (cfg, &uri->data.sks.namespace, name, NULL); GNUNET_free (name); + GNUNET_asprintf (&ret, "%s: %s", unique_name, uri->data.sks.identifier); + GNUNET_free (unique_name); return ret; } @@ -1404,7 +1406,7 @@ GNUNET_FS_uri_test_ksk (const struct GNUNET_FS_Uri *uri) if (uri->type == ksk) { - for (i = uri->data.ksk.keywordCount - 1; i >= 0; i--) + for (i=0;i < uri->data.ksk.keywordCount; i++) GNUNET_assert (uri->data.ksk.keywords[i] != NULL); } #endif @@ -1499,6 +1501,10 @@ find_duplicate (const char *s, const char **array, int array_length) return GNUNET_NO; } + +/** + * FIXME: comment + */ static char * normalize_metadata (enum EXTRACTOR_MetaFormat format, const char *data, size_t data_len)