Changeset 4613 for pjproject/trunk/pjmedia/src/pjmedia-audiodev/alsa_dev.c
- Timestamp:
- Oct 8, 2013 9:08:13 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia-audiodev/alsa_dev.c
r4283 r4613 172 172 { 173 173 char err_msg[128]; 174 int index ;174 int index, len; 175 175 va_list arg; 176 176 … … 181 181 index = snprintf (err_msg, sizeof(err_msg), "ALSA lib: "); 182 182 #endif 183 if (index < 1 || index >= (int)sizeof(err_msg)) { 184 index = sizeof(err_msg)-1; 185 err_msg[index] = '\0'; 186 goto print_msg; 187 } 188 183 189 va_start (arg, fmt); 184 if (index < sizeof(err_msg)-1) 185 index += vsnprintf (err_msg+index, sizeof(err_msg)-index, fmt, arg); 190 if (index < sizeof(err_msg)-1) { 191 len = vsnprintf( err_msg+index, sizeof(err_msg)-index, fmt, arg); 192 if (len < 1 || len >= (int)sizeof(err_msg)-index) 193 len = sizeof(err_msg)-index-1; 194 index += len; 195 err_msg[index] = '\0'; 196 } 186 197 va_end(arg); 187 if (err && index < sizeof(err_msg)-1) 188 index += snprintf (err_msg+index, sizeof(err_msg)-index, ": %s", 189 snd_strerror(err)); 198 if (err && index < sizeof(err_msg)-1) { 199 len = snprintf( err_msg+index, sizeof(err_msg)-index, ": %s", 200 snd_strerror(err)); 201 if (len < 1 || len >= (int)sizeof(err_msg)-index) 202 len = sizeof(err_msg)-index-1; 203 index += len; 204 err_msg[index] = '\0'; 205 } 206 print_msg: 190 207 PJ_LOG (4,(THIS_FILE, "%s", err_msg)); 191 208 }
Note: See TracChangeset
for help on using the changeset viewer.