mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-10-29 17:54:14 +08:00
Merge pull request #495 from tofurky/sfp_normalize_nul
Properly handle NULs when normalizing SFP fields
This commit is contained in:
1 file changed
+1
-1
@@ -95,7 +95,7 @@ bool sfp_read_field(__xdata char *dst, uint8_t sfp, uint8_t start, uint8_t lengt
|
|||||||
dst[i] = c;
|
dst[i] = c;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (length > 0 && dst[--length] == ' ')
|
while (length-- > 0 && (dst[length] == ' ' || dst[length] == NUL))
|
||||||
dst[length] = NUL;
|
dst[length] = NUL;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in new issue
Block a user