[vlc-commits] Do not truncate the last character in net_Gets().
Georgi Chorbadzhiyski
git at videolan.org
Sat Aug 17 20:52:14 CEST 2013
vlc | branch: master | Georgi Chorbadzhiyski <gf at unixsol.org> | Sat Aug 17 21:31:51 2013 +0300| [313194d7faee9a4faf0c0b25f621f09d1f91d4b5] | committer: Rémi Denis-Courmont
Do not truncate the last character in net_Gets().
Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=313194d7faee9a4faf0c0b25f621f09d1f91d4b5
---
src/network/io.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/network/io.c b/src/network/io.c
index 740c990..a8ea870 100644
--- a/src/network/io.c
+++ b/src/network/io.c
@@ -481,9 +481,9 @@ char *net_Gets(vlc_object_t *obj, int fd, const v_socket_t *vs)
buflen++;
}
- buf[--buflen] = '\0';
+ buf[buflen] = '\0';
if (buflen > 0 && buf[buflen - 1] == '\r')
- buf[buflen] = '\0';
+ buf[buflen - 1] = '\0';
return buf;
error:
free(buf);
More information about the vlc-commits
mailing list