mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-18 10:45:27 +02:00
Fix out of range enum casts in deSerialize functions (#14090)
This commit is contained in:
@@ -92,7 +92,7 @@ void PointedThing::deSerialize(std::istream &is)
|
||||
int version = readU8(is);
|
||||
if (version != 0) throw SerializationError(
|
||||
"unsupported PointedThing version");
|
||||
type = (PointedThingType) readU8(is);
|
||||
type = static_cast<PointedThingType>(readU8(is));
|
||||
switch (type) {
|
||||
case POINTEDTHING_NOTHING:
|
||||
break;
|
||||
|
@@ -24,7 +24,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
enum PointedThingType
|
||||
enum PointedThingType : u8
|
||||
{
|
||||
POINTEDTHING_NOTHING,
|
||||
POINTEDTHING_NODE,
|
||||
|
Reference in New Issue
Block a user