summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 699ae55)
raw | patch | inline | side by side (parent: 699ae55)
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 | history |
index 8664732e46248ba58d40c63bcc1ba2307fde4fa9..bfa8ae8560fb1ef393c8680cea81246aa9875221 100644 (file)
--- a/tig.c
+++ b/tig.c
*/
static inline void
-string_ncopy(char *dst, const char *src, int dstlen)
+string_ncopy(char *dst, const char *src, size_t dstlen)
{
strncpy(dst, src, dstlen - 1);
dst[dstlen - 1] = 0;
}
static bool
-string_nformat(char *buf, size_t bufsize, int *bufpos, const char *fmt, ...)
+string_nformat(char *buf, size_t bufsize, size_t *bufpos, const char *fmt, ...)
{
va_list args;
- int pos = bufpos ? *bufpos : 0;
+ size_t pos = bufpos ? *bufpos : 0;
va_start(args, fmt);
pos += vsnprintf(buf + pos, bufsize - pos, fmt, args);
{
static char buf[BUFSIZ];
static char key_char[] = "'X'";
- int pos = 0;
+ size_t pos = 0;
char *sep = " ";
int i;
}
static bool
-add_describe_ref(char *buf, int *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 buf[SIZEOF_STR];
char *commit_id = line->data + STRING_SIZE("commit ");
struct ref **refs;
- int bufpos = 0, refpos = 0;
+ size_t bufpos = 0, refpos = 0;
const char *sep = "Refs: ";
bool is_tag = FALSE;
dirsep[0] = 0;
} else {
- int pathlen = strlen(opt_path);
+ size_t pathlen = strlen(opt_path);
char *basename = data + SIZEOF_TREE_ATTR;
string_format_from(opt_path, &pathlen, "%s/", basename);