Fix num_to_nibble()
authorBarret Rhoden <brho@cs.berkeley.edu>
Tue, 23 Aug 2016 21:12:05 +0000 (17:12 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Tue, 30 Aug 2016 19:34:05 +0000 (15:34 -0400)
commitcd2b9e9dc7254bce197149742810c5d29cf77577
treebec6a7bbc20e8013472475a9caf00f8793d84244
parent6bcb6e04fc9be847cea8d2d25df1eed948958859
Fix num_to_nibble()

If you passed it a negative number, the mod wouldn't take the lower 4 bits.
I originally went with % 16 so it'd be clear we're dealing with 16
characters in the array.  That needed to be unsigned.  While I'm here, I'll
just do the masking too, in case this code gets copied and morphed a bit.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/drivers/dev/version.c