summaryrefslogtreecommitdiff
path: root/docs/examples/fopen.c
diff options
context:
space:
mode:
Diffstat (limited to 'docs/examples/fopen.c')
-rw-r--r--docs/examples/fopen.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/examples/fopen.c b/docs/examples/fopen.c
index a11a522b4..932140e3e 100644
--- a/docs/examples/fopen.c
+++ b/docs/examples/fopen.c
@@ -13,7 +13,7 @@
* See the main() function at the bottom that shows an app that retrieves from
* a specified url using fgets() and fread() and saves as two output files.
*
- * Copyright (c) 2003 - 2019 Simtec Electronics
+ * Copyright (c) 2003 - 2021 Simtec Electronics
*
* Re-implemented by Vincent Sanders <vince@kyllikki.org> with extensive
* reference to original curl example code
@@ -107,7 +107,7 @@ static size_t write_callback(char *buffer,
if(size > rembuff) {
/* not enough space in buffer */
newbuff = realloc(url->buffer, url->buffer_len + (size - rembuff));
- if(newbuff == NULL) {
+ if(!newbuff) {
fprintf(stderr, "callback buffer grow failed\n");
size = rembuff;
}