common OPTIMIZE minor optimizations
diff --git a/src/common.c b/src/common.c
index 806a016..c976de4 100644
--- a/src/common.c
+++ b/src/common.c
@@ -176,12 +176,7 @@
     uint32_t c, aux;
     size_t len;
 
-    if (bytes_read) {
-        (*bytes_read) = 0;
-    }
-
     c = (*input)[0];
-    LY_CHECK_RET(!c, LY_EINVAL);
 
     if (!(c & 0x80)) {
         /* one byte character */
@@ -238,6 +233,9 @@
             return LY_EINVAL;
         }
     } else {
+        if (bytes_read) {
+            (*bytes_read) = 0;
+        }
         return LY_EINVAL;
     }