summary refs log tree commit diff stats
path: root/plugins/checksum
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/checksum')
-rw-r--r--plugins/checksum/checksum.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/plugins/checksum/checksum.c b/plugins/checksum/checksum.c
index 6eb85e77..a4cadc19 100644
--- a/plugins/checksum/checksum.c
+++ b/plugins/checksum/checksum.c
@@ -170,22 +170,24 @@ dccrecv_cb (char *word[], void *userdata)
 	int result;
 	struct stat buffer;									/* buffer for storing file info */
 	char sum[65];											/* buffer for checksum */
-	char *file;
+	const char *file;
+	char *cfile;
+
 	if (hexchat_get_prefs (ph, "dcc_completed_dir", &file, NULL) == 1 && file[0] != 0)
 	{
-		file = g_strconcat (file, G_DIR_SEPARATOR_S, word[1], NULL);
+		cfile = g_strconcat (file, G_DIR_SEPARATOR_S, word[1], NULL);
 	}
 	else
 	{
-		file = g_strdup(word[2]);
+		cfile = g_strdup(word[2]);
 	}
 
-	result = stat (file, &buffer);
+	result = stat (cfile, &buffer);
 	if (result == 0)										/* stat returns 0 on success */
 	{
 		if (buffer.st_size <= (unsigned long long) get_limit () * 1048576)
 		{
-			sha256_file (file, sum);						/* file is the full filename even if completed dir set */
+			sha256_file (cfile, sum);						/* file is the full filename even if completed dir set */
 			/* try to print the checksum in the privmsg tab of the sender */
 			hexchat_set_context (ph, hexchat_find_context (ph, NULL, word[3]));
 			hexchat_printf (ph, "SHA-256 checksum for %s (local):  %s\n", word[1], sum);
@@ -201,7 +203,7 @@ dccrecv_cb (char *word[], void *userdata)
 		hexchat_printf (ph, "File access error!\n");
 	}
 
-	g_free (file);
+	g_free (cfile);
 	return HEXCHAT_EAT_NONE;
 }
 
ins/winsys/winsys-xp.vcxproj?id=567270d5a713d7b9dd3e2f89aaab5b07db4fb55c'>567270d5 ^
de70630c ^
a57a7d3f ^


a57a7d3f ^




cb891a97 ^
fc98a6d7 ^
a57a7d3f ^







cb891a97 ^
a57a7d3f ^





a57a7d3f ^




cb891a97 ^
fc98a6d7 ^
a57a7d3f ^







cb891a97 ^
a57a7d3f ^




cb891a97 ^
a57a7d3f ^

cb891a97 ^
a57a7d3f ^




1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111