Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: src/sbin/raidctl



Module Name:    src
Committed By:   kre
Date:           Wed Nov 22 00:31:31 UTC 2017

Modified Files:
        src/sbin/raidctl: rf_configure.c

Log Message:
Several more cleanups:
1. Don't force use of "for" when "while" works better.
2. No need to check c != '\0' when we also check (c == ' ' || c == '\t')
3. Use the size of the buffer we're using, rather than a different one
   (not really a concern, they're the same size)
4. Don't use fscanf() to read file data, use fgets() & sscanf().
5. After using a pointer as a char *, validate alignment before switching
   to int * (can only fail if kernel #define gets set stupidly)   Or #6...
6. Validate sparemap file name isn't too long for assigned space.
7. recognise that strlen() returns size_t - don't shove it into an int.
8. On out of mem, be more clear which allocation failed in warning msg.

ATF tests all pass.   But I don't think they use sparemap files.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sbin/raidctl/rf_configure.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index