Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

[PATCH] swupdate-progress: Fix parsing of no-reboot message

16 views
Skip to first unread message

Matt Wood

unread,
Jul 18, 2024, 4:30:53 PM7/18/24
to swupdate
Correct sscanf formatting to indicate if a reboot is not required.

Signed-off-by: Matt Wood <matt...@microchip.com>
---
tools/swupdate-progress.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/swupdate-progress.c b/tools/swupdate-progress.c
index 14040757..5e371627 100644
--- a/tools/swupdate-progress.c
+++ b/tools/swupdate-progress.c
@@ -354,7 +354,7 @@ int main(int argc, char **argv)
* will be added, JSON lib should be linked.
* NOTE: Until then, the exact string format is imperative!
*/
- n = sscanf(msg.info, "{\"%*d\": {\"%d\": { \"reboot-mode\" : \"%19[-a-z]\"}}}",
+ n = sscanf(msg.info, "{\"%d\": { \"reboot-mode\" : \"%19[-a-z]\"}}",
&cause, reboot_mode);
if (n == 2) {
if (cause == CAUSE_REBOOT_MODE) {
--
2.34.1
Reply all
Reply to author
Forward
0 new messages