git: sbin/hammer: Make strtrl() api right [2/3]

Tomohiro Kusumi tkusumi at crater.dragonflybsd.org
Sun Apr 12 04:36:22 PDT 2015


commit f2c96727e73f175f2a675b119ddbfec4bb18f5b4
Author: Tomohiro Kusumi <kusumi.tomohiro at gmail.com>
Date:   Sat Apr 11 05:32:18 2015 +0900

    sbin/hammer: Make strtrl() api right [2/3]
    
    - Fix changes made by commit 3c10747d.
    
    - Not sure what the return value of strtrl() is trying to do, but
      checking ==NULL here doesn't mean anything unless 'path' is NULL.
      (The only case that had meaning was when 'path' was NULL, but
      it's pretty obvious callers were not passing NULL)
    
    - Change strnlen() to strlen(). It's better to use strlen() when
      we know the input (argv[i]) is a C string. Also note that in
      this case non NULL terminated char[] of length 'size_t maxlen'
      is useless and does no good anyway.

Summary of changes:
 sbin/hammer/cmd_pseudofs.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/f2c96727e73f175f2a675b119ddbfec4bb18f5b4


-- 
DragonFly BSD source repository



More information about the Commits mailing list