From 8520491f43a3029687ec4b8bda6c5b1c43743002 Mon Sep 17 00:00:00 2001
From: Mohamed Akram <mohd.akram@outlook.com>
Date: Thu, 7 Nov 2024 18:17:14 +0400
Subject: [PATCH] Fix building with newer Clang

---
 getfcomment/main.c        |  2 +-
 geticon/main.m            |  2 +-
 hfsdata/main.c            | 12 ++++++------
 mkalias/mkalias.c         |  2 +-
 setfcomment/setfcomment.c |  2 +-
 setlabel/main.c           |  2 +-
 6 files changed, 11 insertions(+), 11 deletions(-)

diff --git getfcomment/main.c getfcomment/main.c
index 9fd89be..f287f20 100644
--- getfcomment/main.c
+++ getfcomment/main.c
@@ -149,7 +149,7 @@ static void PrintOSXComment (char *path)
             }
 
             //retrieve filespec from file ref
-            err = FSGetCatalogInfo (&fileRef, NULL, NULL, NULL, &fileSpec, NULL);
+            err = FSGetCatalogInfo (&fileRef, 0, NULL, NULL, &fileSpec, NULL);
             if (err != noErr)
             {
 				fprintf(stderr, "FSGetCatalogInfo(): Error %d getting file spec for %s\n", err, path);
diff --git geticon/main.m geticon/main.m
index 305c2be..a4639f1 100644
--- geticon/main.m
+++ geticon/main.m
@@ -144,7 +144,7 @@ static char* CutSuffix (char *name)
   {
     if (name[len-i] == '.')
     {
-      name[len-i] = NULL;
+      name[len-i] = '\0';
       return name;
     }
   }
diff --git hfsdata/main.c hfsdata/main.c
index d499019..9dc8c60 100644
--- hfsdata/main.c
+++ hfsdata/main.c
@@ -596,7 +596,7 @@ static OSErr PrintFileType (FSRef *fileRef)
 	}
 
 	// retrieve filespec from file ref
-    err = FSGetCatalogInfo (fileRef, NULL, NULL, NULL, &fileSpec, NULL);
+    err = FSGetCatalogInfo (fileRef, 0, NULL, NULL, &fileSpec, NULL);
     if (err != noErr)
     {
         fprintf(stderr, "FSGetCatalogInfo(): Error %d getting file spec from file reference\n", err);
@@ -636,7 +636,7 @@ static OSErr PrintCreatorCode (FSRef *fileRef)
 	}
 
 	// retrieve filespec from file ref
-    err = FSGetCatalogInfo (fileRef, NULL, NULL, NULL, &fileSpec, NULL);
+    err = FSGetCatalogInfo (fileRef, 0, NULL, NULL, &fileSpec, NULL);
     if (err != noErr)
     {
         fprintf(stderr, "FSGetCatalogInfo(): Error %d getting file spec from file reference\n", err);
@@ -730,7 +730,7 @@ static OSErr PrintLabelName (FSRef *fileRef)
 	int			labelNum = 0;
 
 	/* retrieve filespec from file ref */
-    err = FSGetCatalogInfo (fileRef, NULL, NULL, NULL, &fileSpec, NULL);
+    err = FSGetCatalogInfo (fileRef, 0, NULL, NULL, &fileSpec, NULL);
     if (err != noErr)
     {
         fprintf(stderr, "FSGetCatalogInfo(): Error %d getting file spec from file reference\n", err);
@@ -772,7 +772,7 @@ static OSErr PrintLabelNumber (FSRef *fileRef)
 	int			labelNum = 0;
 
 	/* retrieve filespec from file ref */
-    err = FSGetCatalogInfo (fileRef, NULL, NULL, NULL, &fileSpec, NULL);
+    err = FSGetCatalogInfo (fileRef, 0, NULL, NULL, &fileSpec, NULL);
     if (err != noErr)
     {
         fprintf(stderr, "FSGetCatalogInfo(): Error %d getting file spec from file reference\n", err);
@@ -1033,7 +1033,7 @@ static OSErr PrintOSXComment (FSRef	*fileRef)
 	AEIdleUPP inIdleProc = NewAEIdleUPP(&MyAEIdleCallback);
 
             //retrieve filespec from file ref
-            err = FSGetCatalogInfo (fileRef, NULL, NULL, NULL, &fileSpec, NULL);
+            err = FSGetCatalogInfo (fileRef, 0, NULL, NULL, &fileSpec, NULL);
             if (err != noErr)
             {
 				fprintf(stderr, "FSGetCatalogInfo(): Error %d getting file spec for %s\n", err);
@@ -1073,7 +1073,7 @@ static OSErr PrintOS9Comment (FSRef *fileRef)
 	char	comment[255] = "\0";
 
 	//retrieve filespec from file ref
-	err = FSGetCatalogInfo (fileRef, NULL, NULL, NULL, &fileSpec, NULL);
+	err = FSGetCatalogInfo (fileRef, 0, NULL, NULL, &fileSpec, NULL);
 	if (err != noErr)
 	{
 		fprintf(stderr, "FSGetCatalogInfo(): Error %d getting file spec\n", err);
diff --git mkalias/mkalias.c mkalias/mkalias.c
index 10a4393..b6457f3 100755
--- mkalias/mkalias.c
+++ mkalias/mkalias.c
@@ -229,7 +229,7 @@ static void CreateAlias (char *srcPath, char *destPath)
   }
 
   //retrieve source filespec from source file ref
-  err = FSGetCatalogInfo (&srcRef, NULL, NULL, NULL, &sourceFSSpec, NULL);
+  err = FSGetCatalogInfo (&srcRef, 0, NULL, NULL, &sourceFSSpec, NULL);
   if (err != noErr)
   {
     fprintf(stderr, "FSGetCatalogInfo(): Error %d getting file spec from source FSRef\n", err);
diff --git setfcomment/setfcomment.c setfcomment/setfcomment.c
index a92ec87..d869a89 100755
--- setfcomment/setfcomment.c
+++ setfcomment/setfcomment.c
@@ -166,7 +166,7 @@ static void SetFileComment (char *path, char *comment)
             }
 
             //retrieve filespec from file ref
-            err = FSGetCatalogInfo (&fileRef, NULL, NULL, NULL, &fileSpec, NULL);
+            err = FSGetCatalogInfo (&fileRef, 0, NULL, NULL, &fileSpec, NULL);
             if (err != noErr)
             {
 				fprintf(stderr, "FSGetCatalogInfo(): Error %d getting file spec for %s\n", err, path);
diff --git setlabel/main.c setlabel/main.c
index 159e448..b280d1c 100644
--- setlabel/main.c
+++ setlabel/main.c
@@ -165,7 +165,7 @@ static void SetFileLabel (char *path, short labelNum)
   }
 
   //retrieve filespec from file ref
-  err = FSGetCatalogInfo (&fileRef, NULL, NULL, NULL, &fileSpec, NULL);
+  err = FSGetCatalogInfo (&fileRef, 0, NULL, NULL, &fileSpec, NULL);
   if (err != noErr)
   {
     fprintf(stderr, "FSGetCatalogInfo(): Error %d getting file spec for %s\n", err, path);
-- 
2.47.0

