Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
}
int pakfire_file_set_abspath(struct pakfire_file* file, const char* path) {
+ // Check if path is set and absolute
+ if (!path || *path != '/') {
+ errno = EINVAL;
+ return 1;
+ }
+
return pakfire_string_set(file->abspath, path);
}
}
PAKFIRE_EXPORT int pakfire_file_set_path(struct pakfire_file* file, const char* path) {
+ // Check if path is set and absolute
+ if (!path || *path != '/') {
+ errno = EINVAL;
+ return 1;
+ }
+
return pakfire_string_set(file->path, path);
}