httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r931434 - /httpd/httpd/trunk/modules/dav/fs/repos.c
Date Wed, 07 Apr 2010 04:40:36 GMT
Author: wrowe
Date: Wed Apr  7 04:40:36 2010
New Revision: 931434

URL: http://svn.apache.org/viewvc?rev=931434&view=rev
Log:
Look ma, portable code.

Modified:
    httpd/httpd/trunk/modules/dav/fs/repos.c

Modified: httpd/httpd/trunk/modules/dav/fs/repos.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/dav/fs/repos.c?rev=931434&r1=931433&r2=931434&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/dav/fs/repos.c (original)
+++ httpd/httpd/trunk/modules/dav/fs/repos.c Wed Apr  7 04:40:36 2010
@@ -23,10 +23,6 @@
 #include "apr_strings.h"
 #include "apr_buckets.h"
 
-#if APR_HAVE_STDIO_H
-#include <stdio.h>              /* for sprintf() */
-#endif
-
 #if APR_HAVE_UNISTD_H
 #include <unistd.h>             /* for getpid() */
 #endif
@@ -308,9 +304,9 @@ static void dav_format_time(int style, a
         /* ### should we use "-00:00" instead of "Z" ?? */
 
         /* 20 chars plus null term */
-        sprintf(buf, "%.4d-%.2d-%.2dT%.2d:%.2d:%.2dZ",
-               tms.tm_year + 1900, tms.tm_mon + 1, tms.tm_mday,
-               tms.tm_hour, tms.tm_min, tms.tm_sec);
+        apr_snprintf(buf, sizeof(buf), "%.4d-%.2d-%.2dT%.2d:%.2d:%.2dZ",
+                     tms.tm_year + 1900, tms.tm_mon + 1, tms.tm_mday,
+                     tms.tm_hour, tms.tm_min, tms.tm_sec);
         return;
     }
 
@@ -900,7 +896,7 @@ static apr_status_t dav_fs_mktemp(apr_fi
 
     do {
         num = (num + 1) % ( 1 << 23 );
-        snprintf(numstr, 7, "%06x", num);
+        apr_snprintf(numstr, 7, "%06x", num);
         rv = apr_file_open(fp, templ,
                            APR_WRITE | APR_CREATE | APR_BINARY | APR_EXCL,
                            APR_OS_DEFAULT, p);



Mime
View raw message