]> prime8.dev >> repos - ttyd.git/commitdiff
src/http.c: fix checking pss's len member (#385)
authorBartosz Biłas <b.bilas@grinn-global.com>
Fri, 19 Jun 2020 02:14:42 +0000 (04:14 +0200)
committerGitHub <noreply@github.com>
Fri, 19 Jun 2020 02:14:42 +0000 (10:14 +0800)
len member is a size_t type so it can't be less than 0 by definition.

Signed-off-by: Bartosz Bilas <b.bilas@grinn-global.com>
src/http.c

index 3297c5c9d6bc47d0efef6669d683fb2c2d8ba857..461df49e6a961bb871ec5afd7798532c98066bb9 100644 (file)
@@ -212,7 +212,7 @@ int callback_http(struct lws *wsi, enum lws_callback_reasons reason, void *user,
       break;
 
     case LWS_CALLBACK_HTTP_WRITEABLE:
-      if (!pss->buffer || pss->len <= 0) {
+      if (!pss->buffer || pss->len == 0) {
         goto try_to_reuse;
       }