Less strict string length check.

A new pathcat function.
Some variables renaming.
This commit is contained in:
Andrea Mazzoleni 2011-09-18 22:15:44 +02:00
parent 9b90b1ce05
commit 813d7073b0
2 changed files with 40 additions and 21 deletions

14
util.h
View file

@ -199,26 +199,32 @@ int sgethex(STREAM* f, void* data, int size);
* Copies a path limiting the size.
* Aborts if too long.
*/
void pathcpy(char* str, size_t size, const char* src);
void pathcpy(char* dst, size_t size, const char* src);
/**
* Concatenates a path limiting the size.
* Aborts if too long.
*/
void pathcat(char* dst, size_t size, const char* src);
/**
* Imports a path limiting the size.
* In Windows all the backslash are converted to the C standard of forward slash.
* Aborts if too long.
*/
void pathimport(char* str, size_t size, const char* src);
void pathimport(char* dst, size_t size, const char* src);
/**
* Prints a path.
* Aborts if too long.
*/
void pathprint(char* str, size_t size, const char* format, ...);
void pathprint(char* dst, size_t size, const char* format, ...);
/**
* Ensures the presence of a terminating slash, if it isn't empty.
* Aborts if too long.
*/
void pathslash(char* str, size_t size);
void pathslash(char* dst, size_t size);
/****************************************************************************/
/* memory */