Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/jedec_dimm/jedec_dimm.c
Show First 20 Lines • Show All 789 Lines • ▼ Show 20 Lines | if (ascii) { | ||||
* string, plus the terminator. | * string, plus the terminator. | ||||
*/ | */ | ||||
(void) snprintf(&dst[(2 * i)], 3, "%02x", byte); | (void) snprintf(&dst[(2 * i)], 3, "%02x", byte); | ||||
} | } | ||||
} | } | ||||
/* If we're dealing with ASCII, convert trailing spaces to NULs. */ | /* If we're dealing with ASCII, convert trailing spaces to NULs. */ | ||||
if (ascii) { | if (ascii) { | ||||
for (i = dstsz; i > 0; i--) { | for (i = dstsz - 1; i > 0; i--) { | ||||
if (dst[i] == ' ') { | if (dst[i] == ' ') { | ||||
dst[i] = 0; | dst[i] = 0; | ||||
} else if (dst[i] == 0) { | } else if (dst[i] == 0) { | ||||
continue; | continue; | ||||
} else { | } else { | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 210 Lines • Show Last 20 Lines |