WIN32 fixes
[deb_libnfs.git] / examples / nfs-ls.c
index c4b9fa938f68aec8476f3433229f2b96f321415f..e0131c8b745d719daaa34f7ca8e62103eca9463c 100644 (file)
@@ -30,7 +30,9 @@
 #include "win32_compat.h"
 #pragma comment(lib, "ws2_32.lib")
 WSADATA wsaData;
+#define PRId64 "ll"
 #else
+#include <inttypes.h>
 #include <string.h>
 #include <sys/stat.h>
 #ifndef AROS
@@ -45,7 +47,6 @@ WSADATA wsaData;
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdint.h>
-#include <inttypes.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
@@ -167,7 +168,7 @@ int main(int argc, char *argv[])
                        continue;
                }
 
-               snprintf(path, 1024, "%s/%s", "/", nfsdirent->name);
+               sprintf(path, "%s/%s", "/", nfsdirent->name);
                ret = nfs_stat(nfs, path, &st);
                if (ret != 0) {
                        fprintf(stderr, "Failed to stat(%s) %s\n", path, nfs_get_error(nfs));
@@ -175,7 +176,9 @@ int main(int argc, char *argv[])
                }
 
                switch (st.st_mode & S_IFMT) {
+#ifndef WIN32
                case S_IFLNK:
+#endif
                case S_IFREG:
                        printf("-");
                        break;