Merge pull request #4 from cesfahani/bug/signed-unsigned-warning

Fixed signed/unsigned comparison warning.
This commit is contained in:
yhirose 2017-03-13 22:30:09 -04:00 committed by GitHub
commit 2c276ed31a

View file

@ -173,14 +173,17 @@ inline int socket_read(socket_t sock, char* ptr, size_t size)
return recv(sock, ptr, size, 0);
}
inline int socket_write(socket_t sock, const char* ptr, size_t size = -1)
inline int socket_write(socket_t sock, const char* ptr, size_t size)
{
if (size == -1) {
size = strlen(ptr);
}
return send(sock, ptr, size, 0);
}
inline int socket_write(socket_t sock, const char* ptr)
{
size_t size = strlen(ptr);
return socket_write(sock, ptr, size);
}
inline bool socket_gets(socket_t sock, char* buf, int bufsiz)
{
// TODO: buffering for better performance