(svn r15135) -Fix/Change: allow str_validate (part of receiving strings from the network) to pass newlines instead of replacing them with question marks, but only when asked to do so.
This commit is contained in:
@@ -233,7 +233,7 @@ uint64 Packet::Recv_uint64()
|
||||
}
|
||||
|
||||
/** Reads a string till it finds a '\0' in the stream */
|
||||
void Packet::Recv_string(char *buffer, size_t size)
|
||||
void Packet::Recv_string(char *buffer, size_t size, bool allow_newlines)
|
||||
{
|
||||
PacketSize pos;
|
||||
char *bufp = buffer;
|
||||
@@ -253,7 +253,7 @@ void Packet::Recv_string(char *buffer, size_t size)
|
||||
}
|
||||
this->pos = pos;
|
||||
|
||||
str_validate(bufp);
|
||||
str_validate(bufp, allow_newlines);
|
||||
}
|
||||
|
||||
#endif /* ENABLE_NETWORK */
|
||||
|
@@ -62,7 +62,7 @@ public:
|
||||
uint16 Recv_uint16();
|
||||
uint32 Recv_uint32();
|
||||
uint64 Recv_uint64();
|
||||
void Recv_string(char *buffer, size_t size);
|
||||
void Recv_string(char *buffer, size_t size, bool allow_newlines = false);
|
||||
};
|
||||
|
||||
Packet *NetworkSend_Init(PacketType type);
|
||||
|
Reference in New Issue
Block a user