You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/03/04 03:40:21 UTC

[GitHub] [incubator-nuttx-apps] xiaoxiang781216 commented on a change in pull request #604: apps/md5: fix md5 result error

xiaoxiang781216 commented on a change in pull request #604:
URL: https://github.com/apache/incubator-nuttx-apps/pull/604#discussion_r587051618



##########
File path: nshlib/nsh_codeccmd.c
##########
@@ -443,8 +443,8 @@ static int cmd_codecs_proc(FAR struct nsh_vtbl_s *vtbl, int argc,
           int i;
 
           md5_final(mac, &ctx);
-          src = (FAR char *)&mac;
-          dest = destbuf;
+          src  = mac;
+          dest = (FAR unsigned char *)destbuf;

Review comment:
       we can keep dest as `char`, only src need change to `unsigned char` to avoid the array index become negative in `hexchars[(*src) >> 4]`.




----------------------------------------------------------------
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.

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