Changeset 777 for soft/giet_vm/applications/rosenfeld/nrc2/src
- Timestamp:
- Feb 4, 2016, 6:25:22 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/applications/rosenfeld/nrc2/src/nrio0.c
r772 r777 26 26 27 27 /* --------------------------------------------------------------------------------------------------- */ 28 IMAGE_EXPORT(void) generate_filename_k_ndigit(char *filename, int k, int ndigit, char *complete_filename )28 IMAGE_EXPORT(void) generate_filename_k_ndigit(char *filename, int k, int ndigit, char *complete_filename, int maxlen) 29 29 /* --------------------------------------------------------------------------------------------------- */ 30 30 { … … 43 43 case 9 : format = "%s%09d.txt"; break; 44 44 } 45 s printf(complete_filename, format, filename, k);45 snprintf(complete_filename, maxlen, format, filename, k); 46 46 } 47 /* ------------------------------------------------------------------------------------------------------------------------------ */48 IMAGE_EXPORT(void) generate_filename_k_ndigit_extension(char *filename, int k, int ndigit, char *extension, char *complete_filename )49 /* ------------------------------------------------------------------------------------------------------------------------------ */47 /* ------------------------------------------------------------------------------------------------------------------------------------------ */ 48 IMAGE_EXPORT(void) generate_filename_k_ndigit_extension(char *filename, int k, int ndigit, char *extension, char *complete_filename, int maxlen) 49 /* ------------------------------------------------------------------------------------------------------------------------------------------ */ 50 50 { 51 51 char *format = "%s%d.%s"; … … 63 63 case 9 : format = "%s%09d.%s"; break; 64 64 } 65 s printf(complete_filename, format, filename, k, extension);65 snprintf(complete_filename, maxlen, format, filename, k, extension); 66 66 } 67 /* ---------------------------------------------------------------------------------------- */68 IMAGE_EXPORT(void) generate_path_filename(char *path, char *filename, char *complete_filename )69 /* ---------------------------------------------------------------------------------------- */67 /* ---------------------------------------------------------------------------------------------------- */ 68 IMAGE_EXPORT(void) generate_path_filename(char *path, char *filename, char *complete_filename, int maxlen) 69 /* ---------------------------------------------------------------------------------------------------- */ 70 70 { 71 s printf(complete_filename, "%s%s", path, filename);71 snprintf(complete_filename, maxlen, "%s%s", path, filename); 72 72 } 73 /* ------------------------------------------------------------------------------------------------------------------- */74 IMAGE_EXPORT(void) generate_path_filename_extension(char *path, char *filename, char *extension, char *complete_filename )75 /* ------------------------------------------------------------------------------------------------------------------- */73 /* ------------------------------------------------------------------------------------------------------------------------------- */ 74 IMAGE_EXPORT(void) generate_path_filename_extension(char *path, char *filename, char *extension, char *complete_filename, int maxlen) 75 /* ------------------------------------------------------------------------------------------------------------------------------- */ 76 76 { 77 s printf(complete_filename, "%s%s.%s", path, filename, extension);77 snprintf(complete_filename, maxlen, "%s%s.%s", path, filename, extension); 78 78 } 79 /* ---------------------------------------------------------------------------------------------------------------------------------------- */80 IMAGE_EXPORT(void) generate_path_filename_suffix_extension(char *path, char *filename, char *suffix, char *extension, char *complete_filename )81 /* ---------------------------------------------------------------------------------------------------------------------------------------- */79 /* ---------------------------------------------------------------------------------------------------------------------------------------------------- */ 80 IMAGE_EXPORT(void) generate_path_filename_suffix_extension(char *path, char *filename, char *suffix, char *extension, char *complete_filename, int maxlen) 81 /* ---------------------------------------------------------------------------------------------------------------------------------------------------- */ 82 82 { 83 s printf(complete_filename, "%s%s%s.%s", path, filename, suffix, extension);83 snprintf(complete_filename, maxlen, "%s%s%s.%s", path, filename, suffix, extension); 84 84 } 85 /* ----------------------------------------------------------------------------------------------------------------------------------------------- */86 IMAGE_EXPORT(void) generate_path_filename_k_ndigit_extension(char *path, char *filename, int k, int ndigit, char *extension, char *complete_filename )87 /* ----------------------------------------------------------------------------------------------------------------------------------------------- */85 /* ----------------------------------------------------------------------------------------------------------------------------------------------------------- */ 86 IMAGE_EXPORT(void) generate_path_filename_k_ndigit_extension(char *path, char *filename, int k, int ndigit, char *extension, char *complete_filename, int maxlen) 87 /* ----------------------------------------------------------------------------------------------------------------------------------------------------------- */ 88 88 { 89 89 char *format = "%s%s%d.%s"; … … 101 101 case 9 : format = "%s%s%09d.%s"; break; 102 102 } 103 s printf(complete_filename, format, path, filename, k, extension);103 snprintf(complete_filename, maxlen, format, path, filename, k, extension); 104 104 } 105 /* -------------------------------------------------------------------------------------------------------------------------------------------------------- */106 IMAGE_EXPORT(void) generate_path_filename_k_ndigit_l_extension(char *path, char *filename, int k, int ndigit, int l, char *extension, char *complete_filename )107 /* -------------------------------------------------------------------------------------------------------------------------------------------------------- */105 /* -------------------------------------------------------------------------------------------------------------------------------------------------------------------- */ 106 IMAGE_EXPORT(void) generate_path_filename_k_ndigit_l_extension(char *path, char *filename, int k, int ndigit, int l, char *extension, char *complete_filename, int maxlen) 107 /* -------------------------------------------------------------------------------------------------------------------------------------------------------------------- */ 108 108 { 109 109 char *format = "%s%s%d_%d.%s"; … … 121 121 case 9 : format = "%s%s%09d_%09d.%s"; break; 122 122 } 123 s printf(complete_filename, format, path, filename, k, l, extension);123 snprintf(complete_filename, maxlen, format, path, filename, k, l, extension); 124 124 } 125 125 // ----------------------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.