Skip to content

Commit a97ad96

Browse files
Daniel LangeDaniel Lange
authored andcommitted
Add comment on why snprintf instead of xSnprintf (omit error handling)
1 parent 5d87093 commit a97ad96

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎Action.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -679,6 +679,7 @@ static Htop_Reaction actionStrace(State* st) {
679679
if (!ok) {
680680
char errmsg[256];
681681
int saved_errno = errno;
682+
// Using snprintf instead of xSnprintf as the latter is meant to fail and crash htop on error
682683
snprintf(errmsg, sizeof(errmsg), "Failed to start tracer: %s", strerror(saved_errno));
683684
InfoScreen_addLine(&ts->super, errmsg);
684685
}

0 commit comments

Comments
 (0)