diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2013-11-08 22:14:07 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2013-11-08 22:17:10 +0100 |
commit | 76c93d23c073ef8b885503b7d28a31ffe2add6d8 (patch) | |
tree | 1dd2d22a197bc40c5330e516969a7cb1ae9bc96f /doc/common.c | |
parent | 559a144f6bbcbb611453f82e655dd7438c14d1a7 (diff) | |
download | gnutls-76c93d23c073ef8b885503b7d28a31ffe2add6d8.tar.gz |
reindented code
Diffstat (limited to 'doc/common.c')
-rw-r--r-- | doc/common.c | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/doc/common.c b/doc/common.c index 4ceaff80cb..492f9b969e 100644 --- a/doc/common.c +++ b/doc/common.c @@ -1,47 +1,47 @@ -char* escape_string( const char* str, char* buffer, int buffer_size) +char *escape_string(const char *str, char *buffer, int buffer_size) { -int i = 0, j = 0; + int i = 0, j = 0; -while( str[i] != 0 && j <buffer_size - 1) { - if (str[i]=='_') { - buffer[j++] = '\\'; - buffer[j++] = '_'; - buffer[j++] = '\\'; - buffer[j++] = '-'; - } else if (str[i]=='#') { - buffer[j++] = '\\'; - buffer[j++] = '#'; - } else { - buffer[j++] = str[i]; - } - i++; -}; + while (str[i] != 0 && j < buffer_size - 1) { + if (str[i] == '_') { + buffer[j++] = '\\'; + buffer[j++] = '_'; + buffer[j++] = '\\'; + buffer[j++] = '-'; + } else if (str[i] == '#') { + buffer[j++] = '\\'; + buffer[j++] = '#'; + } else { + buffer[j++] = str[i]; + } + i++; + }; -buffer[j] = 0; + buffer[j] = 0; -return buffer; + return buffer; } -char* escape_texi_string( const char* str, char* buffer, int buffer_size) +char *escape_texi_string(const char *str, char *buffer, int buffer_size) { -int i = 0, j = 0; + int i = 0, j = 0; -while( str[i] != 0 && j <buffer_size - 1) { - if (str[i]=='_') { - buffer[j++] = '_'; - buffer[j++] = '@'; - buffer[j++] = '-'; - } else { - buffer[j++] = str[i]; - } - i++; -}; + while (str[i] != 0 && j < buffer_size - 1) { + if (str[i] == '_') { + buffer[j++] = '_'; + buffer[j++] = '@'; + buffer[j++] = '-'; + } else { + buffer[j++] = str[i]; + } + i++; + }; -buffer[j] = 0; + buffer[j] = 0; -return buffer; + return buffer; } |