GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
- by the Free Software Foundation; either version 2, or (at your
+ by the Free Software Foundation; either version 3, or (at your
option) any later version.
GNUnet is distributed in the hope that it will be useful, but
*/
struct GNUNET_FS_Uri *
GNUNET_FS_uri_loc_create (const struct GNUNET_FS_Uri *baseUri,
- struct GNUNET_CONFIGURATION_Handle *cfg,
+ const struct GNUNET_CONFIGURATION_Handle *cfg,
struct GNUNET_TIME_Absolute expiration_time)
{
struct GNUNET_FS_Uri *uri;
rpos = in;
while ('\0' != *rpos)
{
- switch (tolower(*rpos))
+ switch (tolower( (unsigned char) *rpos))
{
case 'a':
case 'e':
case 'y':
case 'z':
/* convert characters listed above to lower case */
- *wpos = tolower(*rpos);
+ *wpos = tolower( (unsigned char)*rpos);
wpos++;
case '!':
case '.':
const char *kp;
char **kl;
+ if ( (u1 == NULL) && (u2 == NULL) )
+ return NULL;
+ if (u1 == NULL)
+ return GNUNET_FS_uri_dup (u2);
+ if (u2 == NULL)
+ return GNUNET_FS_uri_dup (u1);
if ( (u1->type != ksk) ||
(u2->type != ksk) )
{
switch (ret->type)
{
case ksk:
+ if (ret->data.ksk.keywordCount >= GNUNET_MAX_MALLOC_CHECKED / sizeof (char*))
+ {
+ GNUNET_break (0);
+ GNUNET_free (ret);
+ return NULL;
+ }
if (ret->data.ksk.keywordCount > 0)
- {
+ {
ret->data.ksk.keywords
= GNUNET_malloc (ret->data.ksk.keywordCount * sizeof (char *));
for (i = 0; i < ret->data.ksk.keywordCount; i++)
pos = searchString;
while ('\0' != *pos)
{
- if ((saw_quote == 0) && (isspace (*pos)))
+ if ((saw_quote == 0) && (isspace ((unsigned char) *pos)))
{
inWord = 0;
}
pos = searchString;
while ('\0' != *pos)
{
- if ((saw_quote == 0) && (isspace (*pos)))
+ if ((saw_quote == 0) && (isspace ( (unsigned char) *pos)))
{
inWord = 0;
*pos = '\0';
static int
needs_percent (char c)
{
- return (!((isalnum (c)) ||
+ return (!((isalnum ( (unsigned char) c)) ||
(c == '-') || (c == '_') || (c == '.') || (c == '~')));
}
}
}
if (hbits > 0)
- ret[len++] = tbl[bits & 63];
+ ret[len] = tbl[bits & 63];
return ret;
}