aboutsummaryrefslogtreecommitdiff
path: root/src/fs/fs_download.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-04-04 11:24:44 +0000
committerChristian Grothoff <christian@grothoff.org>2012-04-04 11:24:44 +0000
commitd80f189a015e725346e0c8509a83ccb33f7eee60 (patch)
tree4c027460e76abf05f0a31050d22afe31d8137e02 /src/fs/fs_download.c
parent2764fd265cdf18522c3d852057bbdbd947072e17 (diff)
downloadgnunet-d80f189a015e725346e0c8509a83ccb33f7eee60.tar.gz
gnunet-d80f189a015e725346e0c8509a83ccb33f7eee60.zip
-allow NULL for emsg
Diffstat (limited to 'src/fs/fs_download.c')
-rw-r--r--src/fs/fs_download.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/fs/fs_download.c b/src/fs/fs_download.c
index d91c9e824..8ae4a29fb 100644
--- a/src/fs/fs_download.c
+++ b/src/fs/fs_download.c
@@ -1773,16 +1773,19 @@ fh_reader (void *cls, uint64_t offset, size_t max, void *buf, char **emsg)
1773 struct GNUNET_DISK_FileHandle *fh = dc->rfh; 1773 struct GNUNET_DISK_FileHandle *fh = dc->rfh;
1774 ssize_t ret; 1774 ssize_t ret;
1775 1775
1776 *emsg = NULL; 1776 if (NULL != emsg)
1777 *emsg = NULL;
1777 if (offset != GNUNET_DISK_file_seek (fh, offset, GNUNET_DISK_SEEK_SET)) 1778 if (offset != GNUNET_DISK_file_seek (fh, offset, GNUNET_DISK_SEEK_SET))
1778 { 1779 {
1779 *emsg = GNUNET_strdup (strerror (errno)); 1780 if (NULL != emsg)
1781 *emsg = GNUNET_strdup (strerror (errno));
1780 return 0; 1782 return 0;
1781 } 1783 }
1782 ret = GNUNET_DISK_file_read (fh, buf, max); 1784 ret = GNUNET_DISK_file_read (fh, buf, max);
1783 if (ret < 0) 1785 if (ret < 0)
1784 { 1786 {
1785 *emsg = GNUNET_strdup (strerror (errno)); 1787 if (NULL != emsg)
1788 *emsg = GNUNET_strdup (strerror (errno));
1786 return 0; 1789 return 0;
1787 } 1790 }
1788 return ret; 1791 return ret;