From: Johannes Schindelin Date: Mon, 26 Oct 2015 13:15:33 GMT Subject: [PATCH 6/6] Correct fscanf formatting string for I64u values Message-ID: <9f9e70a1704d8388f520535192e263089e36860e.1445865176.git.johannes.schindelin@gmx.de> In-Reply-To: From: Waldek Maleska 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 Signed-off-by: Johannes Schindelin --- builtin/gc.c | 2 +- git-compat-util.h | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/builtin/gc.c b/builtin/gc.c index b677923..df3e454 100644 --- a/builtin/gc.c +++ b/builtin/gc.c @@ -240,7 +240,7 @@ static const char *lock_repo_for_gc(int force, pid_t* ret_pid) * running. */ time(NULL) - st.st_mtime <= 12 * 3600 && - fscanf(fp, "%"PRIuMAX" %127c", &pid, locking_host) == 2 && + fscanf(fp, "%"SCNuMAX" %127c", &pid, locking_host) == 2 && /* be gentle to concurrent "gc" on remote hosts */ (strcmp(locking_host, my_host) || !kill(pid, 0) || errno == EPERM); if (fp != NULL) diff --git a/git-compat-util.h b/git-compat-util.h index 610e8a5..87456a3 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -296,6 +296,10 @@ extern char *gitbasename(char *); #define PRIuMAX "llu" #endif +#ifndef SCNuMAX +#define SCNuMAX PRIuMAX +#endif + #ifndef PRIu32 #define PRIu32 "u" #endif -- 2.1.4