From 2e8637afa7a90e7894201cc62dcb1861eb2a9df7 Mon Sep 17 00:00:00 2001 From: Waldek Maleska Date: Tue, 31 Mar 2015 19:47:09 +0100 Subject: [PATCH] Correct fscanf formatting string for I64u values 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 0ad8d30b56..e84a409efd 100644 --- a/builtin/gc.c +++ b/builtin/gc.c @@ -217,7 +217,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 ac571ee479..4fe10cc146 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