Mercurial > gftp.yaz
diff lib/misc.c @ 926:7b5aa0420fe2
2007-6-13 Brian Masney <masneyb@gftp.org>
* lib/misc.c (insert_commas) lib/gftp.h - explictly cast the number to
a long long if it is supported on the system. This fixes a problem
where the number is converted to an integer when the sizeof (off_t) !=
sizeof (long long)
author | masneyb |
---|---|
date | Thu, 14 Jun 2007 02:06:41 +0000 |
parents | 1808cebed602 |
children | 5b681cba67b2 |
line wrap: on
line diff
--- a/lib/misc.c Sat Jun 09 11:50:40 2007 +0000 +++ b/lib/misc.c Thu Jun 14 02:06:41 2007 +0000 @@ -27,9 +27,11 @@ insert_commas (off_t number, char *dest_str, size_t dest_len) { if (dest_str != NULL) - g_snprintf (dest_str, dest_len, GFTP_OFF_T_INTL_PRINTF_MOD, number); + g_snprintf (dest_str, dest_len, GFTP_OFF_T_INTL_PRINTF_MOD, + (GFTP_OFF_T_PRINTF_CONVERSION) number); else - dest_str = g_strdup_printf (GFTP_OFF_T_INTL_PRINTF_MOD, number); + dest_str = g_strdup_printf (GFTP_OFF_T_INTL_PRINTF_MOD, + (GFTP_OFF_T_PRINTF_CONVERSION) number); return (dest_str); } @@ -324,6 +326,15 @@ printf ("sizeof (off_t) = %d\n", sizeof (off_t)); +#ifdef HAVE_INTL_PRINTF + printf ("#define HAVE_INTL_PRINTF\n"); +#endif + + printf ("GFTP_OFF_T_HEX_PRINTF_MOD = %s\n", GFTP_OFF_T_HEX_PRINTF_MOD); + printf ("GFTP_OFF_T_INTL_PRINTF_MOD = %s\n", GFTP_OFF_T_INTL_PRINTF_MOD); + printf ("GFTP_OFF_T_PRINTF_MOD = %s\n", GFTP_OFF_T_PRINTF_MOD); + printf ("GFTP_OFF_T_11PRINTF_MOD = %s\n", GFTP_OFF_T_11PRINTF_MOD); + #ifdef HAVE_GETADDRINFO printf ("#define HAVE_GETADDRINFO\n"); #endif @@ -352,10 +363,6 @@ printf ("#define HAVE_GETTEXT\n"); #endif -#ifdef HAVE_INTL_PRINTF - printf ("#define HAVE_INTL_PRINTF\n"); -#endif - printf ("glib version: %d.%d.%d\n", GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);