examples: Slightly modernize printfs in teststat
authorVolker Lendecke <vl@samba.org>
Mon, 14 Aug 2023 15:28:28 +0000 (17:28 +0200)
committerJeremy Allison <jra@samba.org>
Mon, 25 Sep 2023 19:01:34 +0000 (19:01 +0000)
long long works, but it's a bit too specific now that we have intmax_t

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
examples/libsmbclient/teststat.c

index 714bffebb2d3f974e246af4f697f8bb55c9d2c6f..c8973e6ad0df8b799a29d48505770fe959477897 100644 (file)
@@ -53,10 +53,13 @@ int main(int argc, char * argv[])
                return 1;
        }
 
-       printf("\nSAMBA\n mtime:%lld/%s ctime:%lld/%s atime:%lld/%s\n",
-              (long long)st.st_mtime, ctime_r(&st.st_mtime, m_time),
-              (long long)st.st_ctime, ctime_r(&st.st_ctime, c_time),
-              (long long)st.st_atime, ctime_r(&st.st_atime, a_time));
+       printf("\nSAMBA\n mtime:%jd/%s ctime:%jd/%s atime:%jd/%s\n",
+              (intmax_t)st.st_mtime,
+              ctime_r(&st.st_mtime, m_time),
+              (intmax_t)st.st_ctime,
+              ctime_r(&st.st_ctime, c_time),
+              (intmax_t)st.st_atime,
+              ctime_r(&st.st_atime, a_time));
 
        if (pLocalPath != NULL) {
                ret = stat(pLocalPath, &st);
@@ -65,10 +68,13 @@ int main(int argc, char * argv[])
                        return 1;
                }
 
-               printf("LOCAL\n mtime:%lld/%s ctime:%lld/%s atime:%lld/%s\n",
-                      (long long)st.st_mtime, ctime_r(&st.st_mtime, m_time),
-                      (long long)st.st_ctime, ctime_r(&st.st_ctime, c_time),
-                      (long long)st.st_atime, ctime_r(&st.st_atime, a_time));
+               printf("LOCAL\n mtime:%jd/%s ctime:%jd/%s atime:%jd/%s\n",
+                      (intmax_t)st.st_mtime,
+                      ctime_r(&st.st_mtime, m_time),
+                      (intmax_t)st.st_ctime,
+                      ctime_r(&st.st_ctime, c_time),
+                      (intmax_t)st.st_atime,
+                      ctime_r(&st.st_atime, a_time));
        }
 
        return 0;