path.c: char is not (always) signed
[gitweb.git] / pkt-line.c
index 647bbd3bceda71f15fdf137a37f3fa53e6fa6d86..2827ca772a3703f71bc588d0f6cacd5caa318fe7 100644 (file)
@@ -188,6 +188,12 @@ static int packet_write_gently(const int fd_out, const char *buf, size_t size)
        return 0;
 }
 
+void packet_write(int fd_out, const char *buf, size_t size)
+{
+       if (packet_write_gently(fd_out, buf, size))
+               die_errno("packet write failed");
+}
+
 void packet_buf_write(struct strbuf *buf, const char *fmt, ...)
 {
        va_list args;
@@ -258,7 +264,7 @@ static int get_packet_data(int fd, char **src_buf, size_t *src_size,
        }
 
        /* And complain if we didn't get enough bytes to satisfy the read. */
-       if (ret < size) {
+       if (ret != size) {
                if (options & PACKET_READ_GENTLE_ON_EOF)
                        return -1;