Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'wrapper.c')
-rw-r--r--wrapper.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/wrapper.c b/wrapper.c
index 3a1c0e0526..4ff4a9c3db 100644
--- a/wrapper.c
+++ b/wrapper.c
@@ -105,6 +105,14 @@ char *xstrndup(const char *str, size_t len)
return xmemdupz(str, p ? p - str : len);
}
+int xstrncmpz(const char *s, const char *t, size_t len)
+{
+ int res = strncmp(s, t, len);
+ if (res)
+ return res;
+ return s[len] == '\0' ? 0 : 1;
+}
+
void *xrealloc(void *ptr, size_t size)
{
void *ret;