]> The Tcpdump Group git mirrors - tcpdump/commitdiff
smbutil.c: Replace obsolete function call (asctime)
authorEge Çetin <[email protected]>
Sun, 1 Jan 2023 12:29:03 +0000 (12:29 +0000)
committerfxlb <[email protected]>
Sun, 1 Jan 2023 19:08:42 +0000 (19:08 +0000)
CHANGES
CREDITS
smbutil.c

diff --git a/CHANGES b/CHANGES
index 74640359ea19309a727eba5f5765296f7be18662..908082d23f868b85264152930c693bc9367d1ba6 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -51,6 +51,8 @@ TBD
       Cirrus CI: Run the "make releasecheck" command in the Linux task.
       Makefile.in: Add the whitespacecheck target.
       Cirrus CI: Run the "make whitespacecheck" command in the Linux task.
+    Source code:
+      smbutil.c: Replace obsolete function call (asctime)
 
 Saturday, December 31, 2022 / The Tcpdump Group
   Summary for 4.99.2 tcpdump release
diff --git a/CREDITS b/CREDITS
index 25a860ea79e749326edd403f67b367cd75e3341c..b6862ccba5a8b0bd63cf90053753a9927afcdbe5 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -92,6 +92,7 @@ Additional people who have contributed patches (in alphabetical order):
     Duane Wessels                 <dwessels at verisign dot com>
     Eamon Doyle                   <eamonjd at arista dot com>
     Eddie Kohler                  <xexd at sourceforge dot net>
+    Ege Cetin                     <egecetin at hotmail dot com dot tr>
     Eliot Lear                    <lear at upstairs dot ofcourseimright dot com>
     Elmar Kirchner                <elmar at juniper dot net>
     Eric S. Raymond               <esr at thyrsus dot com>
index ff32ecce2ba43a5a12159ed3d27610654a006feb..7f609f7f3c242aa4a56d3bb9de3e181983154769 100644 (file)
--- a/smbutil.c
+++ b/smbutil.c
@@ -770,6 +770,7 @@ smb_fdata1(netdissect_options *ndo,
            time_t t;
            struct tm *lt;
            const char *tstring;
+           char buffer[sizeof("Www Mmm dd hh:mm:ss yyyy\n")];
            uint32_t x;
 
            switch (atoi(fmt + 1)) {
@@ -800,8 +801,10 @@ smb_fdata1(netdissect_options *ndo,
            }
            if (t != 0) {
                lt = localtime(&t);
-               if (lt != NULL)
-                   tstring = asctime(lt);
+               if (lt != NULL) {
+                   strftime(buffer, sizeof(buffer), "%a %b %e %T %Y%n", lt);
+                   tstring = buffer;
+               }
                else
                    tstring = "(Can't convert time)\n";
            } else