diff options
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/cfgfiles.c | 49 | ||||
-rw-r--r-- | src/common/common-xp.vcxproj | 2 | ||||
-rw-r--r-- | src/common/common.vcxproj | 2 | ||||
-rw-r--r-- | src/common/outbound.c | 3 | ||||
-rw-r--r-- | src/common/server.c | 12 |
5 files changed, 45 insertions, 23 deletions
diff --git a/src/common/cfgfiles.c b/src/common/cfgfiles.c index a4d272bf..516de473 100644 --- a/src/common/cfgfiles.c +++ b/src/common/cfgfiles.c @@ -45,7 +45,8 @@ void list_addentry (GSList ** list, char *cmd, char *name) { struct popup *pop; - int cmd_len = 1, name_len; + size_t name_len; + size_t cmd_len = 1; /* remove <2.8.0 stuff */ if (!strcmp (cmd, "away") && !strcmp (name, "BACK")) @@ -909,35 +910,49 @@ save_config (void) static void set_showval (session *sess, const struct prefs *var, char *tbuf) { - int len, dots, j; + size_t len; + size_t dots; + size_t j; len = strlen (var->name); memcpy (tbuf, var->name, len); dots = 29 - len; + if (dots < 0) + { dots = 0; + } + tbuf[len++] = '\003'; tbuf[len++] = '2'; - for (j=0;j<dots;j++) + + for (j = 0; j < dots; j++) + { tbuf[j + len] = '.'; + } + len += j; + switch (var->type) { - case TYPE_STR: - sprintf (tbuf + len, "\0033:\017 %s\n", - (char *) &prefs + var->offset); - break; - case TYPE_INT: - sprintf (tbuf + len, "\0033:\017 %d\n", - *((int *) &prefs + var->offset)); - break; - case TYPE_BOOL: - if (*((int *) &prefs + var->offset)) - sprintf (tbuf + len, "\0033:\017 %s\n", "ON"); - else - sprintf (tbuf + len, "\0033:\017 %s\n", "OFF"); - break; + case TYPE_STR: + sprintf (tbuf + len, "\0033:\017 %s\n", (char *) &prefs + var->offset); + break; + case TYPE_INT: + sprintf (tbuf + len, "\0033:\017 %d\n", *((int *) &prefs + var->offset)); + break; + case TYPE_BOOL: + if (*((int *) &prefs + var->offset)) + { + sprintf (tbuf + len, "\0033:\017 %s\n", "ON"); + } + else + { + sprintf (tbuf + len, "\0033:\017 %s\n", "OFF"); + } + break; } + PrintText (sess, tbuf); } diff --git a/src/common/common-xp.vcxproj b/src/common/common-xp.vcxproj index 9d0be560..2b5979b6 100644 --- a/src/common/common-xp.vcxproj +++ b/src/common/common-xp.vcxproj @@ -127,7 +127,7 @@ <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions> <AdditionalIncludeDirectories>$(DepsRoot)\include;$(Glib);$(Gtk);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <MultiProcessorCompilation>true</MultiProcessorCompilation> - <DisableSpecificWarnings>4244;4267</DisableSpecificWarnings> + <DisableSpecificWarnings></DisableSpecificWarnings> </ClCompile> <Link> <SubSystem>Windows</SubSystem> diff --git a/src/common/common.vcxproj b/src/common/common.vcxproj index f750e947..60267b2d 100644 --- a/src/common/common.vcxproj +++ b/src/common/common.vcxproj @@ -124,7 +124,7 @@ <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions> <AdditionalIncludeDirectories>$(DepsRoot)\include;$(Glib);$(Gtk);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <MultiProcessorCompilation>true</MultiProcessorCompilation> - <DisableSpecificWarnings>4244;4267;4996</DisableSpecificWarnings> + <DisableSpecificWarnings>4996</DisableSpecificWarnings> </ClCompile> <Link> <SubSystem>Windows</SubSystem> diff --git a/src/common/outbound.c b/src/common/outbound.c index 4e6846e3..05910df9 100644 --- a/src/common/outbound.c +++ b/src/common/outbound.c @@ -4241,7 +4241,8 @@ handle_say (session *sess, char *text, int check_spch) if (strlen (text) > max) { - int i = 0, size; + unsigned int i = 0; + int size; /* traverse the utf8 string and find the nearest cut point that doesn't split 1 char in half */ diff --git a/src/common/server.c b/src/common/server.c index 6c4b3543..360fb2c6 100644 --- a/src/common/server.c +++ b/src/common/server.c @@ -1379,15 +1379,21 @@ base64_encode (char *to, char *from, unsigned int len) } if (len) { - char three[3]={0,0,0}; - int i=0; - for (i=0;i<len;i++) + char three[3] = {0,0,0}; + unsigned int i; + for (i = 0; i < len; i++) + { three[i] = *from++; + } three_to_four (three, to); if (len == 1) + { to[2] = to[3] = '='; + } else if (len == 2) + { to[3] = '='; + } to += 4; }; to[0] = 0; |