mirror of
https://github.com/esphome/esphome.git
synced 2026-07-10 08:55:36 +00:00
[api] Use PROTO_VARINT_PARSE_FAILED constant in parse failure returns
Replace magic {0, 0} with {0, PROTO_VARINT_PARSE_FAILED} in parse_slow()
and parse_wide() for consistency with the named sentinel.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -38,7 +38,7 @@ ProtoVarIntResult ProtoVarInt::parse_slow(const uint8_t *buffer, uint32_t len) {
|
||||
#ifdef USE_API_VARINT64
|
||||
return parse_wide(buffer, len, result32);
|
||||
#else
|
||||
return {0, 0};
|
||||
return {0, PROTO_VARINT_PARSE_FAILED};
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ ProtoVarIntResult ProtoVarInt::parse_wide(const uint8_t *buffer, uint32_t len, u
|
||||
return {result64, i + 1};
|
||||
}
|
||||
}
|
||||
return {0, 0};
|
||||
return {0, PROTO_VARINT_PARSE_FAILED};
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user