summaryrefslogtreecommitdiff
path: root/src/lib-config
diff options
context:
space:
mode:
authorEmanuele Giaquinta <exg@irssi.org>2008-11-12 23:13:57 +0000
committerexg <exg@dbcabf3a-b0e7-0310-adc4-f8d773084564>2008-11-12 23:13:57 +0000
commit169c55b9496aaa8517f18f9f288b9fdf759040df (patch)
tree50f497bfc298e28ddf3955cf904e277b532c2220 /src/lib-config
parent289b1ab81caf9a9059fdc55a2dc5d0811487998e (diff)
downloadirssi-169c55b9496aaa8517f18f9f288b9fdf759040df.zip
Simplify, use 'o' printf conversion specifier to print number in octal.
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4904 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/lib-config')
-rw-r--r--src/lib-config/write.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/src/lib-config/write.c b/src/lib-config/write.c
index 26c40a7e..c5f0a617 100644
--- a/src/lib-config/write.c
+++ b/src/lib-config/write.c
@@ -85,20 +85,6 @@ static int config_has_specials(const char *text)
return FALSE;
}
-static int get_octal(int decimal)
-{
- int octal, pos;
-
- octal = 0; pos = 0;
- while (decimal > 0) {
- octal += (decimal & 7)*(pos == 0 ? 1 : pos);
- decimal /= 8;
- pos += 10;
- }
-
- return octal;
-}
-
static char *config_escape_string(const char *text)
{
GString *str;
@@ -111,7 +97,7 @@ static char *config_escape_string(const char *text)
if (*text == '\\' || *text == '"')
g_string_sprintfa(str, "\\%c", *text);
else if ((unsigned char) *text < 32)
- g_string_sprintfa(str, "\\%03d", get_octal(*text));
+ g_string_sprintfa(str, "\\%03o", *text);
else
g_string_append_c(str, *text);
text++;