*/
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);