dfu: Fix listing devices using the ST reference bootloader

This commit is contained in:
Richard Hughes 2016-10-12 14:02:53 +01:00
parent 877df1dda3
commit c6a8deeb4c
3 changed files with 5 additions and 6 deletions

View File

@ -213,13 +213,10 @@ dfu_target_parse_sector (DfuTarget *target,
return FALSE; return FALSE;
} }
/* optional spaces */
while (tmp[0] == ' ')
tmp++;
/* get multiplier */ /* get multiplier */
switch (tmp[0]) { switch (tmp[0]) {
case 'B': /* byte */ case 'B': /* byte */
case ' ': /* byte, ST reference bootloader :/ */
break; break;
case 'K': /* Kilo */ case 'K': /* Kilo */
sector_size *= 0x400; sector_size *= 0x400;

View File

@ -1817,7 +1817,9 @@ dfu_tool_list_target (DfuTarget *target)
if (tmp != NULL) { if (tmp != NULL) {
/* TRANSLATORS: interface name, e.g. "Flash" */ /* TRANSLATORS: interface name, e.g. "Flash" */
dfu_tool_print_indent (_("Name"), tmp, 2); dfu_tool_print_indent (_("Name"), tmp, 2);
} else { } else if (!g_error_matches (error_local,
DFU_ERROR,
DFU_ERROR_NOT_FOUND)) {
g_autofree gchar *str = NULL; g_autofree gchar *str = NULL;
str = g_strdup_printf ("Error: %s", error_local->message); str = g_strdup_printf ("Error: %s", error_local->message);
dfu_tool_print_indent (_("Name"), str, 2); dfu_tool_print_indent (_("Name"), str, 2);