diff lib/misc.c @ 516:fbb5a02beddb

2004-7-26 Brian Masney <masneyb@gftp.org> * lib/config_file.c lib/local.c lib/ftps.c lib/gftp.h lib/httpcommon.h lib/https.c lib/misc.c lib/protocols.c lib/pty.c lib/rfc2068.c lib/rfc959.c lib/sshv2.c - various fixes found through a static code analysis checker. (some signed/unsigned fixes, removed unneeded casts, removed unneeded variables, more consistency, largefile fixes). Thanks to Derek M Jones for running the static code analysis for me * lib/cache.c - s/remove/del_entry/g * lib/bookmark.c lib/protocols.c (gftp_parse_bookmark) - allow the third parameter of this function to be a NULL pointer
author masneyb
date Tue, 27 Jul 2004 02:46:54 +0000
parents 39e9945288ea
children bccfdbfaac00
line wrap: on
line diff
--- a/lib/misc.c	Mon Jul 26 09:51:07 2004 +0000
+++ b/lib/misc.c	Tue Jul 27 02:46:54 2004 +0000
@@ -17,10 +17,9 @@
 /*  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA      */
 /*****************************************************************************/
 
-static const char cvsid[] = "$Id$";
-
 #include "gftp.h"
 #include "options.h"
+static const char cvsid[] = "$Id$";
 
 #ifdef HAVE_INTL_PRINTF
 
@@ -28,21 +27,9 @@
 insert_commas (off_t number, char *dest_str, size_t dest_len)
 {
   if (dest_str != NULL)
-    {
-#if defined (_LARGEFILE_SOURCE)
-      g_snprintf (dest_str, dest_len, "%'lld", (long long) number);
-#else
-      g_snprintf (dest_str, dest_len, "%'ld", number);
-#endif
-    }
+    g_snprintf (dest_str, dest_len, GFTP_OFF_T_PRINTF_MOD, number);
   else
-    {
-#if defined (_LARGEFILE_SOURCE)
-      dest_str = g_strdup_printf ("%'lld", (long long) number);
-#else
-      dest_str = g_strdup_printf ("%'ld", number);
-#endif
-    }
+    dest_str = g_strdup_printf (GFTP_OFF_T_PRINTF_MOD, number);
 
   return (dest_str);
 }
@@ -56,11 +43,7 @@
   size_t num, rem, srclen;
   int len, i;
 
-#if defined (_LARGEFILE_SOURCE)
-  g_snprintf (src, sizeof (src), "%lld", (long long) number);
-#else
-  g_snprintf (src, sizeof (src), "%ld", number);
-#endif
+  g_snprintf (src, sizeof (src), GFTP_OFF_T_PRINTF_MOD, number);
 
   if (dest_str != NULL)
     *dest_str = '\0';
@@ -890,7 +873,7 @@
   else
     {
 #if defined (_LARGEFILE_SOURCE)
-      tempstr2 = g_strdup_printf ("%11lld", (long long) fle->size);
+      tempstr2 = g_strdup_printf ("%11lld", fle->size);
 #else
       tempstr2 = g_strdup_printf ("%11ld", fle->size);
 #endif