Merge branch 'dev'
This commit is contained in:
		
						commit
						cb830fa511
					
				
							
								
								
									
										20
									
								
								src/lfile.c
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								src/lfile.c
									
									
									
									
									
								
							| @ -63,14 +63,11 @@ char* lfile_basePath(void) { | ||||
| int lfile_dirMakeExist(const char* path, ...) { | ||||
|   char file[PATH_MAX]; | ||||
|   va_list ap; | ||||
|   size_t l; | ||||
| 
 | ||||
|   l = 0; | ||||
|   if(path == NULL) return -1; | ||||
|   else { /* Get the message. */ | ||||
|     va_start(ap, path); | ||||
|     vsnprintf(file, PATH_MAX-l, path, ap); | ||||
|     l = strlen(file); | ||||
|     vsnprintf(file, PATH_MAX, path, ap); | ||||
|     va_end(ap); | ||||
|   } | ||||
| 
 | ||||
| @ -100,14 +97,11 @@ int lfile_dirMakeExist(const char* path, ...) { | ||||
| int lfile_fileExists(const char* path, ...) { | ||||
|   char file[PATH_MAX]; | ||||
|   va_list ap; | ||||
|   size_t l; | ||||
| 
 | ||||
|   l = 0; | ||||
|   if(path == NULL) return -1; | ||||
|   else { /* Get the message. */ | ||||
|     va_start(ap, path); | ||||
|     vsnprintf(file, PATH_MAX-l, path, ap); | ||||
|     l = strlen(file); | ||||
|     vsnprintf(file, PATH_MAX, path, ap); | ||||
|     va_end(ap); | ||||
|   } | ||||
| 
 | ||||
| @ -136,16 +130,13 @@ char** lfile_readDir(int* lfiles, const char* path, ...) { | ||||
|   char file[PATH_MAX], base[PATH_MAX]; | ||||
|   char** files; | ||||
|   va_list ap; | ||||
|   size_t l; | ||||
| 
 | ||||
|   l = 0; | ||||
|   if(path == NULL) { | ||||
|     *lfiles = 0; | ||||
|     return NULL; | ||||
|   } else { /* Get the message. */ | ||||
|     va_start(ap, path); | ||||
|     vsnprintf(base, PATH_MAX-l, path, ap); | ||||
|     l = strlen(base); | ||||
|     vsnprintf(base, PATH_MAX, path, ap); | ||||
|     va_end(ap); | ||||
|   } | ||||
| 
 | ||||
| @ -251,15 +242,12 @@ char** lfile_readDir(int* lfiles, const char* path, ...) { | ||||
| int lfile_touch(const char* path, ...) { | ||||
|   char file[PATH_MAX]; | ||||
|   va_list ap; | ||||
|   size_t l; | ||||
|   FILE* f; | ||||
| 
 | ||||
|   l = 0; | ||||
|   if(path == NULL) return -1; | ||||
|   else { /* Get the message. */ | ||||
|     va_start(ap, path); | ||||
|     vsnprintf(file, PATH_MAX-l, path, ap); | ||||
|     l = strlen(file); | ||||
|     vsnprintf(file, PATH_MAX, path, ap); | ||||
|     va_end(ap); | ||||
|   } | ||||
| 
 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Allanis
						Allanis