diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2008-09-26 06:45:28 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2008-09-26 06:45:28 +0000 |
commit | 62457bce0b6d23c1b6a8206582ac3dd206d4225d (patch) | |
tree | 42428d54daf3273242003827d16ae37d81e50230 /compat | |
parent | df2b3bcf44299d7060b3bc6c17c6e80a1f358692 (diff) |
Trim.
Diffstat (limited to 'compat')
-rw-r--r-- | compat/asprintf.c | 58 | ||||
-rw-r--r-- | compat/forkpty-irix.c | 4 |
2 files changed, 31 insertions, 31 deletions
diff --git a/compat/asprintf.c b/compat/asprintf.c index 05e8dd24..41ae64a7 100644 --- a/compat/asprintf.c +++ b/compat/asprintf.c @@ -1,4 +1,4 @@ -/* $Id: asprintf.c,v 1.3 2008-06-23 21:54:48 nicm Exp $ */ +/* $Id: asprintf.c,v 1.4 2008-09-26 06:45:28 nicm Exp $ */ /* * Copyright (c) 2006 Nicholas Marriott <nicm@users.sourceforge.net> @@ -58,32 +58,32 @@ error: return (-1); } #else -int -vasprintf(char **ret, const char *fmt, va_list ap) -{ - va_list aq; - size_t len; - char *buf; - int n; - - len = 64; - buf = xmalloc(len); - - for (;;) { - va_copy(aq, ap); - n = vsnprintf(buf, len, fmt, aq); - va_end(aq); - - if (n != -1) { - *ret = buf; - return (n); - } - - if (len > SIZE_MAX / 2) { - xfree(buf); - return (-1); - } - len *= 2; - } -} +int +vasprintf(char **ret, const char *fmt, va_list ap) +{ + va_list aq; + size_t len; + char *buf; + int n; + + len = 64; + buf = xmalloc(len); + + for (;;) { + va_copy(aq, ap); + n = vsnprintf(buf, len, fmt, aq); + va_end(aq); + + if (n != -1) { + *ret = buf; + return (n); + } + + if (len > SIZE_MAX / 2) { + xfree(buf); + return (-1); + } + len *= 2; + } +} #endif diff --git a/compat/forkpty-irix.c b/compat/forkpty-irix.c index 1e0f689e..c7809b68 100644 --- a/compat/forkpty-irix.c +++ b/compat/forkpty-irix.c @@ -1,4 +1,4 @@ -/* $Id: forkpty-irix.c,v 1.1 2008-06-23 21:54:48 nicm Exp $ */ +/* $Id: forkpty-irix.c,v 1.2 2008-09-26 06:45:28 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net> @@ -50,7 +50,7 @@ forkpty(int *master, close(*master); setsid(); - + old = signal(SIGHUP, SIG_IGN); vhangup(); signal(SIGHUP, old); |