o Fix semantics of comparison function for qsort(3). According to qsort(3)
manpage: The comparison function must return an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second. Therefore, simply returning "arg1 > arg2" is incorrect. Actually it works but for the number of items to be sorted less than 7 due to special case handling in qsort(3); o add missing '\n' to one of usage() calls. Approved by: phk
This commit is contained in:
parent
2758535974
commit
6122c0cd5e
@ -480,7 +480,11 @@ sorthelp(const void *a, const void *b)
|
||||
|
||||
oa = a;
|
||||
ob = b;
|
||||
return (*oa > *ob);
|
||||
if (*oa > *ob)
|
||||
return 1;
|
||||
if (*oa < *ob)
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -721,7 +725,7 @@ main(int argc, char **argv)
|
||||
if ((i = modfind("g_bde")) < 0) {
|
||||
/* need to load the gbde module */
|
||||
if (kldload(GBDEMOD) < 0 || modfind("g_bde") < 0) {
|
||||
usage(GBDEMOD ": Kernel module not available");
|
||||
usage(GBDEMOD ": Kernel module not available\n");
|
||||
}
|
||||
}
|
||||
doopen = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user