← Back to team overview

linuxdcpp-team team mailing list archive

[Branch ~dcplusplus-team/dcpp-plugin-sdk-c/trunk] Rev 6: satisfy old ansi c rules for local variable declarations

 

------------------------------------------------------------
revno: 6
committer: crise <crise@xxxxxxxxxx>
branch nick: trunk
timestamp: Mon 2012-12-31 05:47:16 +0200
message:
  satisfy old ansi c rules for local variable declarations
modified:
  pluginsdk/Config.c


--
lp:dcpp-plugin-sdk-c
https://code.launchpad.net/~dcplusplus-team/dcpp-plugin-sdk-c/trunk

Your team Dcplusplus-team is subscribed to branch lp:dcpp-plugin-sdk-c.
To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcpp-plugin-sdk-c/trunk/+edit-subscription
=== modified file 'pluginsdk/Config.c'
--- pluginsdk/Config.c	2012-12-27 21:18:53 +0000
+++ pluginsdk/Config.c	2012-12-31 03:47:16 +0000
@@ -27,12 +27,12 @@
 char* guid;
 
 Bool DCAPI init_cfg(DCCorePtr core, const char* pluginGuid) {
-	config = (DCConfigPtr)core->query_interface(DCINTF_CONFIG, DCINTF_CONFIG_VER);
-
-	int len = strlen(pluginGuid) + 1;
+	size_t len = strlen(pluginGuid) + 1;
 	guid = (char*)memset(malloc(len), 0, len);
 	strncpy(guid, pluginGuid, len);
 
+	config = (DCConfigPtr)core->query_interface(DCINTF_CONFIG, DCINTF_CONFIG_VER);
+
 	return config ? True : False;
 }
 
@@ -42,7 +42,7 @@
 
 char* DCAPI get_cfg(const char* name) {
 	ConfigStrPtr val = (ConfigStrPtr)config->get_cfg(guid, name, CFG_TYPE_STRING);
-	int len = strlen(val->value) + 1;
+	size_t len = strlen(val->value) + 1;
 	char* value = (char*)memset(malloc(len), 0, len);
 
 	strncpy(value, val->value, len);