* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
-#include <sys/stat.h>
-#include <dirent.h>
#include "gmqcc.h"
/*
directory = (char *)mem_a(56);
memset(pathsplit, 0, 56);
- memset(directory, 0, 56);
strncpy(directory, entry, 56);
for (itr = 0; (token = pak_tree_sep(&directory, "/")) != NULL; itr++) {
*/
/* TODO backup directory clean */
+ mem_d(pak);
return NULL;
}
pak->insert = true;
pak->header.magic = PAK_FOURCC;
+ /* on BE systems we need to swap the byte order of the FOURCC */
+ util_endianswap(&pak->header.magic, 1, sizeof(uint32_t));
+
/*
* We need to write out the header since files will be wrote out to
* this even with directory entries, and that not wrote. The header
return false;
}
- strcpy(dir.name, file);
+ strncpy(dir.name, file, strlen(file));
/*
* Allocate some memory for loading in the data that will be