* @param cfg configuration to use for path expansion
* @param orig string to $-expand (will be freed!)
* @param depth recursion depth, used to detect recursive expansions
- * @return $-expanded string
+ * @return $-expanded string, never NULL unless @a orig was NULL
*/
static char *
expand_dollar (const struct GNUNET_CONFIGURATION_Handle *cfg,
continue;
dup = GNUNET_strdup (orig + i);
dup = expand_dollar (cfg, dup, 0);
+ GNUNET_assert (NULL != dup); /* make compiler happy */
len = strlen (dup) + 1;
orig = GNUNET_realloc (orig, i + len);
GNUNET_memcpy (orig + i, dup, len);
return strlen (enc);
}
+
#define cvtfind(a) \
((((a) >= 'A') && ((a) <= 'Z')) \
? (a) - 'A' \
"ignoring CR/LF\n"); \
i++; \
if (i >= len) \
- goto END; \
+ goto END; \
}
output = GNUNET_malloc ((len * 3 / 4) + 8);
case 0:
break; // No pad chars in this case
case 2:
- strncpy (&s[len], "==", 2);
+ memcpy (&s[len],
+ "==",
+ 2);
+ len += 2;
break; // Two pad chars
case 3:
s[len] = '=';
+ len++;
break; // One pad char
default:
GNUNET_assert (0);
break;
}
- ret = GNUNET_STRINGS_base64_decode (s, strlen (s), out);
+ ret = GNUNET_STRINGS_base64_decode (s, len, out);
GNUNET_free (s);
return ret;
}