mirror of
https://github.com/avrdudes/avrdude.git
synced 2026-09-29 04:18:54 +03:00
Use avr_cc_buffer() instead of static buffer for returning a string
This commit is contained in:
@@ -185,19 +185,18 @@ static void dumpBlock(const char *prefix, const unsigned char *buf, int len)
|
||||
}
|
||||
}
|
||||
|
||||
static char *usbErrorText(int usbErrno)
|
||||
{
|
||||
static char buffer[32];
|
||||
|
||||
static const char *usbErrorText(int usbErrno) {
|
||||
switch(usbErrno){
|
||||
case USB_ERROR_NONE: return "Success";
|
||||
case USB_ERROR_ACCESS: return "Access denied";
|
||||
case USB_ERROR_NOTFOUND:return "Device not found";
|
||||
case USB_ERROR_BUSY: return "Device is busy";
|
||||
case USB_ERROR_IO: return "I/O Error";
|
||||
default:
|
||||
default: {
|
||||
char *buffer = avr_cc_buffer(32);
|
||||
sprintf(buffer, "Unknown error %d", usbErrno);
|
||||
return buffer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user