{"thread":{"id":"7662","subject":"[PATCH 02/02] ident.c: Use size_t (instead of int) to store sizes","startedAt":"2007-04-15T18:51:29Z","lastAt":"2007-04-15T18:51:29Z","messageCount":1,"participants":["Luiz Fernando N. Capitulino"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"39380","messageId":"20070415155129.162caa17@gnut","threadId":"7662","inReplyTo":null,"subject":"[PATCH 02/02] ident.c: Use size_t (instead of int) to store sizes","fromName":"Luiz Fernando N. Capitulino","fromEmail":"lcapitulino@mandriva.com.br","sentAt":"2007-04-15T18:51:29Z","receivedAt":"2007-04-15T18:51:29Z","isPatch":true,"sender":{"key":"lcapitulino@mandriva.com.br","avatar":null},"body":"\nSigned-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>\n---\n ident.c |   14 +++++++-------\n 1 files changed, 7 insertions(+), 7 deletions(-)\n\ndiff --git a/ident.c b/ident.c\nindex 454aace..fa267ef 100644\n--- a/ident.c\n+++ b/ident.c\n@@ -9,10 +9,10 @@\n \n static char git_default_date[50];\n \n-static void copy_gecos(const struct passwd *w, char *name, int sz)\n+static void copy_gecos(const struct passwd *w, char *name, size_t sz)\n {\n \tchar *src, *dst;\n-\tint len, nlen;\n+\tsize_t len, nlen;\n \n \tnlen = strlen(w->pw_name);\n \n@@ -49,7 +49,7 @@ static void copy_email(const struct passwd *pw)\n \t * Make up a fake email address\n \t * (name + '@' + hostname [+ '.' + domainname])\n \t */\n-\tint len = strlen(pw->pw_name);\n+\tsize_t len = strlen(pw->pw_name);\n \tif (len > sizeof(git_default_email)/2)\n \t\tdie(\"Your sysadmin must hate you!\");\n \tmemcpy(git_default_email, pw->pw_name, len);\n@@ -95,9 +95,9 @@ static void setup_ident(void)\n \t\tdatestamp(git_default_date, sizeof(git_default_date));\n }\n \n-static int add_raw(char *buf, int size, int offset, const char *str)\n+static int add_raw(char *buf, size_t size, int offset, const char *str)\n {\n-\tint len = strlen(str);\n+\tsize_t len = strlen(str);\n \tif (offset + len > size)\n \t\treturn size;\n \tmemcpy(buf + offset, str, len);\n@@ -131,9 +131,9 @@ static int crud(unsigned char c)\n  * Copy over a string to the destination, but avoid special\n  * characters ('\\n', '<' and '>') and remove crud at the end\n  */\n-static int copy(char *buf, int size, int offset, const char *src)\n+static int copy(char *buf, size_t size, int offset, const char *src)\n {\n-\tint i, len;\n+\tsize_t i, len;\n \tunsigned char c;\n \n \t/* Remove crud from the beginning.. */\n-- \n1.5.1.1.86.gfd56-dirty\n"}]}