Started working on a refactored version
This commit is contained in:
23
src/entry.c
Normal file
23
src/entry.c
Normal file
@@ -0,0 +1,23 @@
|
||||
#include "entry.h"
|
||||
|
||||
#include "utils.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
bool is_entry_id_valid(const char* entry_id) {
|
||||
if (entry_id == NULL)
|
||||
return false;
|
||||
|
||||
size_t length = strlen(entry_id);
|
||||
|
||||
if (length == 0 || length > MAX_ENTRY_LENGTH)
|
||||
return false;
|
||||
|
||||
for (size_t i = 0; i < length; i++)
|
||||
if (entry_id[i] == '/')
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
Reference in New Issue
Block a user