[vlc-devel] commit: net_vaPrintf: fix error handling ( Rémi Denis-Courmont )

git version control git at videolan.org
Sat Aug 9 10:49:08 CEST 2008


vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Sat Aug  9 11:50:33 2008 +0300| [954040034fe72e2ba7887313fa679a28179bb40d] | committer: Rémi Denis-Courmont 

net_vaPrintf: fix error handling

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=954040034fe72e2ba7887313fa679a28179bb40d
---

 src/network/io.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/network/io.c b/src/network/io.c
index 0f52527..2d6ffb2 100644
--- a/src/network/io.c
+++ b/src/network/io.c
@@ -539,9 +539,11 @@ ssize_t __net_vaPrintf( vlc_object_t *p_this, int fd, const v_socket_t *p_vs,
                         const char *psz_fmt, va_list args )
 {
     char    *psz;
-    int     i_size, i_ret;
+    int      i_ret;
 
-    i_size = vasprintf( &psz, psz_fmt, args );
+    size_t i_size = vasprintf( &psz, psz_fmt, args );
+    if( i_size == -1 )
+        return -1;
     i_ret = __net_Write( p_this, fd, p_vs, (uint8_t *)psz, i_size ) < i_size
         ? -1 : i_size;
     free( psz );




More information about the vlc-devel mailing list