Mon Mar 2 11:21:17 CST 2009 Pekka Pessi <first.last@nokia.com>

* sl_utils_print.c: propagate error from fwrite()



git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12375 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris 2009-03-03 17:19:58 +00:00
parent 094de86372
commit 97c72d0a46
2 changed files with 8 additions and 1 deletions

View File

@ -1 +1 @@
Tue Mar 3 11:18:41 CST 2009
Tue Mar 3 11:19:17 CST 2009

View File

@ -218,11 +218,18 @@ issize_t sl_payload_print(FILE *stream, char const *prefix, sip_payload_t const
crlf = su_strnspn(s + n, end - s - n, "\r\n");
if (prefix)
fputs(prefix, stream), total += strlen(prefix);
v v v v v v v
actual = fwrite(s, 1, n + crlf, stream) ;
if (actual == 0)
return -1;
s += actual;
total += actual;
*************
if (fwrite(s, 1, n + crlf, stream) < n + crlf)
return (issize_t)-1;
s += n + crlf;
total += n + crlf;
^ ^ ^ ^ ^ ^ ^
}
if (crlf == 0)
fputs("\n", stream), total++;