[ https://issues.apache.org/jira/browse/HDFS-3643?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13430750#comment-13430750 ]
Colin Patrick McCabe commented on HDFS-3643: -------------------------------------------- Looks good in general. While you're refactoring, I would recommend using the libc function index(2) instead of the handrolled loop. It's a little more idiomatic, and probably better optimized to boot. Also, you'll probably need to rebase now that invokeMethod returns an exception or NULL rather than a numeric error code. You probably want to use return newRuntimeException() on error, or similar. > hdfsJniHelper.c unchecked string pointers > ----------------------------------------- > > Key: HDFS-3643 > URL: https://issues.apache.org/jira/browse/HDFS-3643 > Project: Hadoop HDFS > Issue Type: Bug > Components: libhdfs > Affects Versions: 2.0.0-alpha > Reporter: Andy Isaacson > Assignee: Andy Isaacson > Attachments: hdfs3643.txt > > > {code} > str = methSignature; > while (*str != ')') str++; > str++; > returnType = *str; > {code} > This loop needs to check for {{'\0'}}. Also the following {{if/else if/else > if}} cascade doesn't handle unexpected values. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira