23 lines
475 B
C
23 lines
475 B
C
#include "include/data.h"
|
|
|
|
#include <string.h>
|
|
|
|
int name_verify(const char* name) {
|
|
if (!name) return 0;
|
|
if (strlen(name) > NAME_MAX_LENGTH) return 0;
|
|
return 1;
|
|
}
|
|
|
|
int msg_verify(const char* content) {
|
|
if (!content) return 0;
|
|
if (strlen(content) > MSG_MAX_LENGTH) return 0;
|
|
return 1;
|
|
}
|
|
|
|
int room_verify(const char* room) {
|
|
if (!room) return 0;
|
|
if (strlen(room) == 0) return 0;
|
|
if (strlen(room) > ROOM_MAX_LENGTH) return 0;
|
|
return 1;
|
|
}
|