Changeset 386
- Timestamp:
- Apr 2, 2004, 4:35:18 AM (22 years ago)
- File:
-
- 1 edited
-
trunk/archive/pslib/src/Utils/error.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/archive/pslib/src/Utils/error.c
r332 r386 146 146 ...) // arguments for format 147 147 { 148 va_list ap; 149 /* 150 * Print header? 151 */ 152 if (fmt != NULL) { 153 va_start(ap, fmt); 154 } 155 156 psVErrorStackPrint(fd, fmt, ap); 157 158 if (fmt != NULL) { 159 va_end(ap); 160 } 161 } 162 163 void psVErrorStackPrint(FILE *fd, // write to this file descriptor 164 const char *fmt,// format for any header information; may be NULL 165 va_list ap) // arguments for format 166 { 148 167 static int first = 1; 149 168 … … 171 190 */ 172 191 if (fmt != NULL) { 173 v a_list ap;174 va_start(ap, fmt);175 vprintf(fmt, ap);176 va_end(ap);192 vfprintf(fd, fmt, ap); 193 if (strchr(fmt, '\n') == NULL) { 194 fprintf(fd, "\n"); 195 } 177 196 } 178 197 /* … … 187 206 188 207 for (int i = 0; i < nerror; i++) { 208 int code = stack[i]->error.code; 189 209 fprintf(fd, "%*s%-*s %-30s %s\n", 190 210 i, "", 30 - i, stack[i]->error.name, 191 errorStringList[stack[i]->error.code], stack[i]->error.msg);192 } 193 } 211 (code < PS_ERR_BASE ? strerror(code) : errorStringList[code]), stack[i]->error.msg); 212 } 213 }
Note:
See TracChangeset
for help on using the changeset viewer.
