summaryrefslogtreecommitdiff
path: root/hardinfo2
diff options
context:
space:
mode:
authorLeandro A. F. Pereira <leandro@hardinfo.org>2007-10-20 12:59:16 +0000
committerLeandro A. F. Pereira <leandro@hardinfo.org>2007-10-20 12:59:16 +0000
commit20f10899a0018ffce790496cc87b4d51e68716f9 (patch)
tree8b64dc941b7df569f0f7a245ed8bbc54d3f88b3a /hardinfo2
parentd5160894773f5be501469fd3bba06211000ca798 (diff)
Fix crash, SCSI detection on newer kernels.
Diffstat (limited to 'hardinfo2')
-rw-r--r--hardinfo2/arch/linux/common/storage.h6
-rw-r--r--hardinfo2/shell.c7
-rw-r--r--hardinfo2/util.c1
3 files changed, 11 insertions, 3 deletions
diff --git a/hardinfo2/arch/linux/common/storage.h b/hardinfo2/arch/linux/common/storage.h
index cd3c3249..71c206cd 100644
--- a/hardinfo2/arch/linux/common/storage.h
+++ b/hardinfo2/arch/linux/common/storage.h
@@ -79,9 +79,13 @@ __scan_scsi_devices(void)
model = g_strdup_printf("%s %s", vendor, model + 7);
} else if (!strncmp(buf, "Type: ", 8)) {
- char *p = strstr(buf, "ANSI SCSI revi");
+ char *p;
gchar *type = NULL, *icon = NULL;
+ if (!(p = strstr(buf, "ANSI SCSI revision"))) {
+ p = strstr(buf, "ANSI SCSI revision");
+ }
+
if (p != NULL) {
while (*(--p) == ' ');
*(++p) = 0;
diff --git a/hardinfo2/shell.c b/hardinfo2/shell.c
index 0d32f2a9..00d18be7 100644
--- a/hardinfo2/shell.c
+++ b/hardinfo2/shell.c
@@ -524,6 +524,11 @@ static void add_modules_to_gui(gpointer data, gpointer user_data)
}
}
+static void __tree_iter_destroy(gpointer data)
+{
+ gtk_tree_iter_free((GtkTreeIter *) data);
+}
+
void shell_init(GSList * modules)
{
if (shell) {
@@ -544,7 +549,7 @@ void shell_init(GSList * modules)
shell->moreinfo = info_tree_new(TRUE);
shell->loadgraph = load_graph_new(75);
update_tbl = g_hash_table_new_full(g_str_hash, g_str_equal,
- g_free, g_free);
+ g_free, __tree_iter_destroy);
gtk_paned_pack1(GTK_PANED(shell->hpaned), shell->tree->scroll,
SHELL_PACK_RESIZE, SHELL_PACK_SHRINK);
diff --git a/hardinfo2/util.c b/hardinfo2/util.c
index c3022a08..79f4aef3 100644
--- a/hardinfo2/util.c
+++ b/hardinfo2/util.c
@@ -996,7 +996,6 @@ gchar *h_strdup_cprintf(const gchar * format, gchar * source, ...)
retn = buffer;
}
-
return retn;
}