X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=help.c;h=1cd33ece6bcec6f71c6749205c18c0f413034d89;hb=d7f6bae28142e07e544efdab73260cf9f60ca899;hp=0893fea0254f4ec8acbce82a0af41e4e61bd72a6;hpb=fbe3d87e5fcef2e0fff41c3b0589331c889dfb59;p=git.git diff --git a/help.c b/help.c index 0893fea02..1cd33ece6 100644 --- a/help.c +++ b/help.c @@ -31,12 +31,6 @@ static int term_columns(void) return 80; } -static void oom(void) -{ - fprintf(stderr, "git: out of memory\n"); - exit(1); -} - static inline void mput_char(char c, unsigned int num) { while(num--) @@ -54,13 +48,9 @@ static void add_cmdname(const char *name, int len) struct cmdname *ent; if (cmdname_alloc <= cmdname_cnt) { cmdname_alloc = cmdname_alloc + 200; - cmdname = realloc(cmdname, cmdname_alloc * sizeof(*cmdname)); - if (!cmdname) - oom(); + cmdname = xrealloc(cmdname, cmdname_alloc * sizeof(*cmdname)); } - ent = malloc(sizeof(*ent) + len); - if (!ent) - oom(); + ent = xmalloc(sizeof(*ent) + len); ent->len = len; memcpy(ent->name, name, len); ent->name[len] = 0; @@ -229,5 +219,3 @@ int cmd_help(int argc, const char **argv, const char *prefix) return 0; } - -