From 0d343202a4d1844fd65f7429435875b529de266f Mon Sep 17 00:00:00 2001 From: Alexander Dahl Date: Tue, 24 Jul 2018 15:12:58 +0200 Subject: [PATCH] doc: Fix more spelling mistakes Found with a recent version of codespell. Signed-off-by: Alexander Dahl --- examples/session/session_ex1/restricted.c | 2 +- examples/session/session_ex1/session.c | 2 +- examples/simple_form/form2.c | 2 +- examples/strings/explode.c | 2 +- include/libcgi/cgi.h | 2 +- src/base64.c | 2 +- src/cgi.c | 6 +++--- src/general.c | 2 +- src/session.c | 4 ++-- src/string.c | 18 +++++++++--------- 10 files changed, 21 insertions(+), 21 deletions(-) diff --git a/examples/session/session_ex1/restricted.c b/examples/session/session_ex1/restricted.c index 624e5e7..17aade9 100644 --- a/examples/session/session_ex1/restricted.c +++ b/examples/session/session_ex1/restricted.c @@ -52,7 +52,7 @@ int main(void) else { puts("" "In this page you can register" - "any session variable you want. Here is a good place to test session suport, and " + "any session variable you want. Here is a good place to test session support, and " "here you can see all already registered variables!!!|" "" "
" diff --git a/examples/session/session_ex1/session.c b/examples/session/session_ex1/session.c index d950b48..b18271e 100644 --- a/examples/session/session_ex1/session.c +++ b/examples/session/session_ex1/session.c @@ -32,7 +32,7 @@ int main(void) " " "" "" - "This is the main page of LibCGI session suport test. Please choose one of the options" + "This is the main page of LibCGI session support test. Please choose one of the options" "in the navigation bar." "" "" diff --git a/examples/simple_form/form2.c b/examples/simple_form/form2.c index a1d511a..d644b65 100644 --- a/examples/simple_form/form2.c +++ b/examples/simple_form/form2.c @@ -31,7 +31,7 @@ int main(void) if (cgi_param("age")) printf("Age: %s
", cgi_param("age")); else - puts("Age: Emtpy
"); + puts("Age: Empty
"); // GENDER printf("Gender: %s
", cgi_param("gender")); diff --git a/examples/strings/explode.c b/examples/strings/explode.c index df6d5dd..d5ba12b 100644 --- a/examples/strings/explode.c +++ b/examples/strings/explode.c @@ -25,7 +25,7 @@ int main() cgi_process_form(); cgi_init_headers(); - // The form was submited?? + // The form was submitted?? if (cgi_param("action")) { str = cgi_param("str"); delim = cgi_param("delim"); diff --git a/include/libcgi/cgi.h b/include/libcgi/cgi.h index 0e5679e..4c6c049 100644 --- a/include/libcgi/cgi.h +++ b/include/libcgi/cgi.h @@ -92,7 +92,7 @@ extern "C" { // general purpose linked list. Actually isn't very portable // because uses only 'name' and 'value' variables to store data. -// Problably, in a future release, this will be replaced by +// Probably, in a future release, this will be replaced by // another type of struct typedef struct formvarsA { char *name; diff --git a/src/base64.c b/src/base64.c index 44aaf8a..3195f65 100644 --- a/src/base64.c +++ b/src/base64.c @@ -57,7 +57,7 @@ void decodeblock( unsigned char in[4], unsigned char out[3] ) */ /** -* Encodes a given tring to its base64 form. +* Encodes a given string to its base64 form. * * @param *str String to convert * @return Base64 encoded String diff --git a/src/cgi.c b/src/cgi.c index 13f993e..6279543 100644 --- a/src/cgi.c +++ b/src/cgi.c @@ -151,7 +151,7 @@ formvars *process_data(const char *query, formvars **start, formvars **last, /** * Process HTML form or URL data. -* Used to retrieve GET or POST data. It handles automaticaly the correct REQUEST_METHOD, so you don't need to afraid about it. +* Used to retrieve GET or POST data. It handles automatically the correct REQUEST_METHOD, so you don't need to afraid about it. * @return Returns the contents of URL or FORM into a formvars variable, or NULL if FALSE. Most of time, you * don't need any variable to store the form data, because is used an internal variable to manipulate the contents. * @see cgi_init, cgi_init_headers @@ -226,7 +226,7 @@ void cgi_fatal(const char *msg) /** * Include static files. -* Function used to include static data ( normaly html files ). +* Function used to include static data ( normally html files ). * File contents will never be processed. * Note that I don't scan for any special character. The reason * I did it is, if the you are using this library, you have a shell @@ -546,7 +546,7 @@ char *cgi_param(const char *var_name) /** * Sends a specific header. * Sends a specific HTTP header. You won't need to add '\\n\\n' chars. -* @param header HTTP header to send, without new line characteres +* @param header HTTP header to send, without new line characters * @return True * @see cgi_init_headers **/ diff --git a/src/general.c b/src/general.c index 2df3a31..9ef7455 100644 --- a/src/general.c +++ b/src/general.c @@ -138,7 +138,7 @@ char **file(const char *filename, unsigned int *total) // initial line length columms = 100; - // How many characteres in the line + // How many characters in the line char_count = 1; i = 0; diff --git a/src/session.c b/src/session.c index b85abb8..ef70cc5 100644 --- a/src/session.c +++ b/src/session.c @@ -20,7 +20,7 @@ */ /***************************************************** - * The varibles/functions beginning with sess_ are + * The variables/functions beginning with sess_ are * for manipulation internly only. You can use * the session_ like functions/variables ***************************************************** @@ -197,7 +197,7 @@ int cgi_session_destroy() // hhhmmm.. if (headers_initialized) - libcgi_error(E_WARNING, "Headers alreay sent. session_destroy() can't fully unregister the session"); + libcgi_error(E_WARNING, "Headers already sent. session_destroy() can't fully unregister the session"); else cgi_add_cookie(SESSION_COOKIE_NAME, "", 0, 0, 0, 0); diff --git a/src/string.c b/src/string.c index c5564f9..9859634 100644 --- a/src/string.c +++ b/src/string.c @@ -85,7 +85,7 @@ char *addnslashes(char *s, int n) * Add slashes to a string when necessary. * Adds a '\' in every quote ( " ), apostrophe ( ' ) or backslash ( \ ) * It's useful when working with databases, for example, because -* someone can try insert this caracters to try hack the application... +* someone can try insert this characters to try hack the application... * @param *s String to parse * @return The new string, with slashes * @see stripslashes, addnslashes @@ -292,7 +292,7 @@ char *substr(char *src, const int start, const int count) * @param token Character delimiter to search. * @param total An integer variable passed as reference, which stores the total of * itens of the array -* @return The array, where each item is one separeted by token +* @return The array, where each item is one separated by token * * \code * @@ -372,8 +372,8 @@ char **explode(char *src, const char *token, int *total) } /** -* Replace characteres in a string, but not more than 'n'. -* Replace all occourences of *delim on *src with characteres pointed by *with, +* Replace characters in a string, but not more than 'n'. +* Replace all occourences of *delim on *src with characters pointed by *with, * stopping after 'n' char. * @param *src String to parse * @param *delim Character to search that will be replaced @@ -422,7 +422,7 @@ char *str_nreplace(char *src, const char *delim, const char *with, int n) for (i = 0; i < w_len; i++) buf[counter++] = with[i]; } - // otherwise, only do a simple character subtitution + // otherwise, only do a simple character substitution buf[counter++] = *with; } else @@ -437,10 +437,10 @@ char *str_nreplace(char *src, const char *delim, const char *with, int n) } /** -* Replace characteres in a string. -* Replace all occourences of *delim on *src with characteres pointed by *with. +* Replace characters in a string. +* Replace all occourences of *delim on *src with characters pointed by *with. * The problem with the following code is that the function only searches for the -* first character of *delim, ingoring the rest. Other problem is speed relacioned: +* first character of *delim, ignoring the rest. Other problem is speed relacioned: * note that the function ever compare the length of *with to do the correct action. * @param src String to parse * @param delim Character to search that will be replaced @@ -507,7 +507,7 @@ int strpos(char *s, char *ch) * Delete count characters of s, starting in start * @param s String to search * @param start Initial offset to begin search -* @param count Number of characteres to delete +* @param count Number of characters to delete * @return The new string * @see strndel() *