diff options
| author | Michael Kerrisk <mtk.manpages@gmail.com> | 2013-12-30 20:53:19 +1300 |
|---|---|---|
| committer | Michael Kerrisk <mtk.manpages@gmail.com> | 2014-01-02 11:49:15 +1300 |
| commit | aefd6f899dfa38ccb324cb8096fb6709eb4754db (patch) | |
| tree | 061deb1b10f8f8e7a8916cf8e6990b0c6c1db8ee /man3/printf.3 | |
| parent | b0e6462a0bedf1e291656bbd20ba74105f7adfbe (diff) | |
| download | man-pages-aefd6f899dfa38ccb324cb8096fb6709eb4754db.tar.gz | |
select_tut.2, dlopen.3, err.3, printf.3: Stylistic changes to code example
For ease of reading, don't embed assignments inside if().
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Diffstat (limited to 'man3/printf.3')
| -rw-r--r-- | man3/printf.3 | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/man3/printf.3 b/man3/printf.3 index 12373f1ee7..79cabf6a12 100644 --- a/man3/printf.3 +++ b/man3/printf.3 @@ -31,7 +31,7 @@ .\" 2000-07-26 jsm28@hermes.cam.ac.uk - three small fixes .\" 2000-10-16 jsm28@hermes.cam.ac.uk - more fixes .\" -.TH PRINTF 3 2013-09-04 "GNU" "Linux Programmer's Manual" +.TH PRINTF 3 2013-12-30 "GNU" "Linux Programmer's Manual" .SH NAME printf, fprintf, sprintf, snprintf, vprintf, vfprintf, vsprintf, vsnprintf \- formatted output conversion @@ -1043,7 +1043,8 @@ make_message(const char *fmt, ...) char *p, *np; va_list ap; - if ((p = malloc(size)) == NULL) + p = malloc(size); + if (p == NULL) return NULL; while (1) { @@ -1071,7 +1072,8 @@ make_message(const char *fmt, ...) size = n + 1; /* Precisely what is needed */ - if ((np = realloc (p, size)) == NULL) { + np = realloc(p, size); + if (np == NULL) { free(p); return NULL; } else { |
