fix(inputs.s7comm): Truncate strings to reported length (#14283)
This commit is contained in:
parent
e57da21f83
commit
fd65ce80d8
|
|
@ -29,7 +29,7 @@ func determineConversion(dtype string) converterFunc {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
// Get the length of the encoded string
|
// Get the length of the encoded string
|
||||||
length := int(buf[0])
|
length := int(buf[1])
|
||||||
// Clip the string if we do not fill the whole buffer
|
// Clip the string if we do not fill the whole buffer
|
||||||
if length < len(buf)-2 {
|
if length < len(buf)-2 {
|
||||||
return string(buf[2 : 2+length])
|
return string(buf[2 : 2+length])
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue