Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
ident.c: Use size_t (instead of int) to store sizes
author
Luiz Fernando N. Capitulino
<lcapitulino@mandriva.com.br>
Sun, 15 Apr 2007 18:51:29 +0000
(15:51 -0300)
committer
Junio C Hamano
<junkio@cox.net>
Sun, 15 Apr 2007 22:59:09 +0000
(15:59 -0700)
Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Junio C Hamano <junkio@cox.net>
ident.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
0b952a9
)
diff --git
a/ident.c
b/ident.c
index b557ecd5397833ad14816e9fe61aa0880446303f..88e7f74e888f1c7b13182bf07afee01408e8e525 100644
(file)
--- a/
ident.c
+++ b/
ident.c
@@
-9,10
+9,10
@@
static char git_default_date[50];
static char git_default_date[50];
-static void copy_gecos(const struct passwd *w, char *name,
in
t sz)
+static void copy_gecos(const struct passwd *w, char *name,
size_
t sz)
{
char *src, *dst;
{
char *src, *dst;
-
in
t len, nlen;
+
size_
t len, nlen;
nlen = strlen(w->pw_name);
nlen = strlen(w->pw_name);
@@
-49,7
+49,7
@@
static void copy_email(const struct passwd *pw)
* Make up a fake email address
* (name + '@' + hostname [+ '.' + domainname])
*/
* Make up a fake email address
* (name + '@' + hostname [+ '.' + domainname])
*/
-
in
t len = strlen(pw->pw_name);
+
size_
t len = strlen(pw->pw_name);
if (len > sizeof(git_default_email)/2)
die("Your sysadmin must hate you!");
memcpy(git_default_email, pw->pw_name, len);
if (len > sizeof(git_default_email)/2)
die("Your sysadmin must hate you!");
memcpy(git_default_email, pw->pw_name, len);
@@
-95,9
+95,9
@@
static void setup_ident(void)
datestamp(git_default_date, sizeof(git_default_date));
}
datestamp(git_default_date, sizeof(git_default_date));
}
-static int add_raw(char *buf,
in
t size, int offset, const char *str)
+static int add_raw(char *buf,
size_
t size, int offset, const char *str)
{
{
-
in
t len = strlen(str);
+
size_
t len = strlen(str);
if (offset + len > size)
return size;
memcpy(buf + offset, str, len);
if (offset + len > size)
return size;
memcpy(buf + offset, str, len);
@@
-131,9
+131,9
@@
static int crud(unsigned char c)
* Copy over a string to the destination, but avoid special
* characters ('\n', '<' and '>') and remove crud at the end
*/
* Copy over a string to the destination, but avoid special
* characters ('\n', '<' and '>') and remove crud at the end
*/
-static int copy(char *buf,
in
t size, int offset, const char *src)
+static int copy(char *buf,
size_
t size, int offset, const char *src)
{
{
-
in
t i, len;
+
size_
t i, len;
unsigned char c;
/* Remove crud from the beginning.. */
unsigned char c;
/* Remove crud from the beginning.. */