mlondono74 commented on code in PR #1423:
URL: 
https://github.com/apache/incubator-nuttx-apps/pull/1423#discussion_r1028322280


##########
netutils/netlib/netlib_ipv6route.c:
##########
@@ -131,9 +131,12 @@ ssize_t netlib_read_ipv6route(FILE *stream,
       return 0;
     }
 
-  /* The first line of the group should consist of a number index */
+  /* The first non-space char of the first line of the group should consist of 
a number index */
+  int idx = 0;
+  while (isspace(line[idx]))
+    idx++;

Review Comment:
   The second commit in the PR fixes the format comments and a couple of 
automated warnings.  I did forget to update `line[0] `to `line [idx]` when 
creating the PR from a clean fork.  This is corrected in the second PR, thanks 
for catching it.
   As far as `addr = &line[ADDR_OFFSET];` not knowing about idx, I do not see a 
problem with that.  That line just wants to make sure there is a NULL teminator 
at the max PROCFS line length.  Idx is only there to avoid a failed check of ` 
if (line[0] < '0' || line[0] > '9')` as was the case in the original code. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to