Skip to content

Commit 2e8ecdd

Browse files
weakcameldscho
authored andcommitted
Correct fscanf formatting string for I64u values
Signed-off-by: Waldek Maleska <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
1 parent d74a85f commit 2e8ecdd

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

builtin/gc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ static const char *lock_repo_for_gc(int force, pid_t* ret_pid)
222222
* running.
223223
*/
224224
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 &&
226226
/* be gentle to concurrent "gc" on remote hosts */
227227
(strcmp(locking_host, my_host) || !kill(pid, 0) || errno == EPERM);
228228
if (fp != NULL)

git-compat-util.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,10 @@ extern char *gitbasename(char *);
245245
#define PRIuMAX "llu"
246246
#endif
247247

248+
#ifndef SCNuMAX
249+
#define SCNuMAX PRIuMAX
250+
#endif
251+
248252
#ifndef PRIu32
249253
#define PRIu32 "u"
250254
#endif

0 commit comments

Comments
 (0)