Correct fscanf formatting string for I64u values

This fix is probably purely cosmetic because PRIuMAX is likely identical to SCNuMAX. Nevertheless, when using a function of the scanf() family, the correct interpolation to use is the latter, not the former. Signed-off-by: Waldek Maleska <w.maleska@gmail.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Waldek Maleska committed Oct 26, 2015 at 14:15 UTC fdcdb778551b904d57c127d9a3546f6a7c8792d3
2 files changed +5 -1
builtin/gc.c
+1 -1
@@ -222,7 +222,7 @@ static const char *lock_repo_for_gc(int force, pid_t* ret_pid)
222 * running.
223 */
224 time(NULL) - st.st_mtime <= 12 * 3600 &&
225 - fscanf(fp, "%"PRIuMAX" %127c", &pid, locking_host) == 2 &&
225 + fscanf(fp, "%"SCNuMAX" %127c", &pid, locking_host) == 2 &&
226 /* be gentle to concurrent "gc" on remote hosts */
227 (strcmp(locking_host, my_host) || !kill(pid, 0) || errno == EPERM);
228 if (fp != NULL)
git-compat-util.h
+4
@@ -237,6 +237,10 @@ extern char *gitbasename(char *);
237 #define PRIuMAX "llu"
238 #endif
239
240 +#ifndef SCNuMAX
241 +#define SCNuMAX PRIuMAX
242 +#endif
243 +
244 #ifndef PRIu32
245 #define PRIu32 "u"
246 #endif