chiark
/
gitweb
/
~mdw
/
tig
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
699ae55
)
Use size_t instead of int for string_* functions
author
Jonas Fonseca
<fonseca@diku.dk>
Sun, 10 Sep 2006 20:56:28 +0000
(22:56 +0200)
committer
Jonas Fonseca
<fonseca@antimatter.localdomain>
Sun, 10 Sep 2006 20:56:28 +0000
(22:56 +0200)
tig.c
patch
|
blob
|
blame
|
history
diff --git
a/tig.c
b/tig.c
index 8664732e46248ba58d40c63bcc1ba2307fde4fa9..bfa8ae8560fb1ef393c8680cea81246aa9875221 100644
(file)
--- a/
tig.c
+++ b/
tig.c
@@
-145,7
+145,7
@@
set_from_int_map(struct int_map *map, size_t map_size,
*/
static inline void
*/
static inline void
-string_ncopy(char *dst, const char *src,
in
t dstlen)
+string_ncopy(char *dst, const char *src,
size_
t dstlen)
{
strncpy(dst, src, dstlen - 1);
dst[dstlen - 1] = 0;
{
strncpy(dst, src, dstlen - 1);
dst[dstlen - 1] = 0;
@@
-172,10
+172,10
@@
chomp_string(char *name)
}
static bool
}
static bool
-string_nformat(char *buf, size_t bufsize,
in
t *bufpos, const char *fmt, ...)
+string_nformat(char *buf, size_t bufsize,
size_
t *bufpos, const char *fmt, ...)
{
va_list args;
{
va_list args;
-
in
t pos = bufpos ? *bufpos : 0;
+
size_
t pos = bufpos ? *bufpos : 0;
va_start(args, fmt);
pos += vsnprintf(buf + pos, bufsize - pos, fmt, args);
va_start(args, fmt);
pos += vsnprintf(buf + pos, bufsize - pos, fmt, args);
@@
-847,7
+847,7
@@
get_key(enum request request)
{
static char buf[BUFSIZ];
static char key_char[] = "'X'";
{
static char buf[BUFSIZ];
static char key_char[] = "'X'";
-
in
t pos = 0;
+
size_
t pos = 0;
char *sep = " ";
int i;
char *sep = " ";
int i;
@@
-2270,7
+2270,7
@@
pager_draw(struct view *view, struct line *line, unsigned int lineno)
}
static bool
}
static bool
-add_describe_ref(char *buf,
in
t *bufpos, char *commit_id, const char *sep)
+add_describe_ref(char *buf,
size_
t *bufpos, char *commit_id, const char *sep)
{
char refbuf[SIZEOF_STR];
char *ref = NULL;
{
char refbuf[SIZEOF_STR];
char *ref = NULL;
@@
-2303,7
+2303,7
@@
add_pager_refs(struct view *view, struct line *line)
char buf[SIZEOF_STR];
char *commit_id = line->data + STRING_SIZE("commit ");
struct ref **refs;
char buf[SIZEOF_STR];
char *commit_id = line->data + STRING_SIZE("commit ");
struct ref **refs;
-
in
t bufpos = 0, refpos = 0;
+
size_
t bufpos = 0, refpos = 0;
const char *sep = "Refs: ";
bool is_tag = FALSE;
const char *sep = "Refs: ";
bool is_tag = FALSE;
@@
-2543,7
+2543,7
@@
tree_enter(struct view *view, struct line *line)
dirsep[0] = 0;
} else {
dirsep[0] = 0;
} else {
-
in
t pathlen = strlen(opt_path);
+
size_
t pathlen = strlen(opt_path);
char *basename = data + SIZEOF_TREE_ATTR;
string_format_from(opt_path, &pathlen, "%s/", basename);
char *basename = data + SIZEOF_TREE_ATTR;
string_format_from(opt_path, &pathlen, "%s/", basename);