mirror of
https://github.com/thepigeongenerator/mcaselector-lite.git
synced 2025-12-18 20:35:45 +01:00
remove unused function nbt_cmpstr, since we're performing this check directly now.
This commit is contained in:
@@ -13,19 +13,6 @@ const u8 *nbt_nexttag(const u8 *restrict buf, u16 naml) {
|
|||||||
return buf + naml + len + 3;
|
return buf + naml + len + 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* compares the string in `buf` to `matstr`.
|
|
||||||
* returns `=0` if equal, `>0` if buf is greater, `<0` if matstr is greater. */
|
|
||||||
static int nbt_cmpstr(const char *restrict matstr, const u8 *restrict buf) {
|
|
||||||
u16 len = be16toh(*(u16 *)buf);
|
|
||||||
|
|
||||||
// allocate and copy bytes
|
|
||||||
char str[len + 1];
|
|
||||||
memcpy(str, buf + 2, len);
|
|
||||||
str[len] = '\0';
|
|
||||||
|
|
||||||
return strncmp(str, matstr, len);
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: not actually doing anything
|
// TODO: not actually doing anything
|
||||||
/* readies the output data for export, returns the new buffer position, or `NULL` upon an error (may be out of bounds) */
|
/* readies the output data for export, returns the new buffer position, or `NULL` upon an error (may be out of bounds) */
|
||||||
static const u8 *nbt_proctag(const u8 *restrict buf, u16 slen) {
|
static const u8 *nbt_proctag(const u8 *restrict buf, u16 slen) {
|
||||||
|
|||||||
Reference in New Issue
Block a user