*/
#include "platform.h"
-#if HAVE_ICONV_H
+#if HAVE_ICONV
#include <iconv.h>
#endif
#include "gnunet_common.h"
}
}
ret = GNUNET_malloc (32);
- GNUNET_snprintf (ret, 32, "%llu%s", size, unit);
+ GNUNET_snprintf (ret, 32, "%llu %s", size, unit);
return ret;
}
tmp = GNUNET_malloc (tmpSize);
itmp = tmp;
finSize = tmpSize;
- if (iconv (cd,
-#if FREEBSD
- (const char **) &input,
+ if (iconv (cd,
+#if FREEBSD || DARWIN
+ (const char **) &input,
#else
- (char **) &input,
+ (char **) &input,
#endif
- &len, &itmp, &finSize) == (size_t) - 1)
+ &len, &itmp, &finSize) == SIZE_MAX)
{
GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "iconv");
iconv_close (cd);
char *ret;
uint64_t dval = delta.value;
+ if (delta.value == GNUNET_TIME_UNIT_FOREVER_REL.value)
+ return GNUNET_strdup (_("eternity"));
if (dval > 5 * 1000)
{
dval = dval / 1000;
}
}
}
- GNUNET_asprintf (&ret, "%llu%s", dval, unit);
+ GNUNET_asprintf (&ret, "%llu %s", dval, unit);
return ret;
}
time_t tt;
char *ret;
+ if (t.value == GNUNET_TIME_UNIT_FOREVER_ABS.value)
+ return GNUNET_strdup (_("end of time"));
tt = t.value / 1000;
#ifdef ctime_r
ret = ctime_r (&tt, GNUNET_malloc (32));