This repository has been archived on 2025-09-15. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
alsa-scarlett-gui/src/error.c
Geoffrey D. Bennett 52f8c7ab8c Fix format-security warning in error.c
gtk_message_dialog_new() takes a format string which should be "%s" in
this case, not the string to display. Reported by Sebastian.
2022-03-17 17:06:19 +10:30

24 lines
504 B
C

// SPDX-FileCopyrightText: 2022 Geoffrey D. Bennett <g@b4.vu>
// SPDX-License-Identifier: GPL-3.0-or-later
#include "error.h"
void show_error(GtkWindow *w, char *s) {
if (!w) {
printf("%s\n", s);
return;
}
GtkWidget *dialog = gtk_message_dialog_new(
w,
GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE,
"%s",
s
);
gtk_widget_show(dialog);
g_signal_connect(dialog, "response", G_CALLBACK(gtk_window_destroy), NULL);
}