X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=git-compat-util.h;h=81883e7270daadafb4d827e894fa4645ff2e2b66;hb=7fd739cd5720fbd1d170584baff7e4f706df641c;hp=02a73eeb667e798fca29de25fed6b0b2900f6912;hpb=6baa9bd882fe003478c42ee5709dcfc713e13ec9;p=git.git diff --git a/git-compat-util.h b/git-compat-util.h index 02a73eeb6..81883e727 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -160,6 +160,10 @@ extern char *gitbasename(char *); #define PRIx32 "x" #endif +#ifndef PRIo32 +#define PRIo32 "o" +#endif + #ifndef PATH_SEP #define PATH_SEP ':' #endif @@ -312,6 +316,11 @@ extern size_t gitstrlcpy(char *, const char *, size_t); extern uintmax_t gitstrtoumax(const char *, char **, int); #endif +#ifdef NO_STRTOK_R +#define strtok_r gitstrtok_r +extern char *gitstrtok_r(char *s, const char *delim, char **save_ptr); +#endif + #ifdef NO_HSTRERROR #define hstrerror githstrerror extern const char *githstrerror(int herror); @@ -388,6 +397,8 @@ extern int odb_pack_keep(char *name, size_t namesz, unsigned char *sha1); static inline size_t xsize_t(off_t len) { + if (len > (size_t) len) + die("Cannot handle files this big"); return (size_t)len; }