summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 989206f)
raw | patch | inline | side by side (parent: 989206f)
author | Daniel Lowe <dlowe@bitmuse.com> | |
Mon, 10 Nov 2008 21:07:52 +0000 (16:07 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 11 Nov 2008 22:43:59 +0000 (14:43 -0800) |
These were found using gcc 4.3.2-1ubuntu11 with the warning:
warning: format not a string literal and no format arguments
Incorporated suggestions from Brandon Casey <casey@nrlssc.navy.mil>.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
warning: format not a string literal and no format arguments
Incorporated suggestions from Brandon Casey <casey@nrlssc.navy.mil>.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-remote.c | patch | blob | history | |
bundle.c | patch | blob | history | |
environment.c | patch | blob | history | |
fsck.c | patch | blob | history | |
grep.c | patch | blob | history | |
path.c | patch | blob | history | |
refs.c | patch | blob | history | |
unpack-trees.c | patch | blob | history |
diff --git a/builtin-remote.c b/builtin-remote.c
index 584280fbf5bbbd485a1388adb15104a1ad1cf19c..5af4e643eb9dceccc62a5ce44069e0164bc12311 100644 (file)
--- a/builtin-remote.c
+++ b/builtin-remote.c
/* make sure that symrefs are deleted */
if (flags & REF_ISSYMREF)
- return unlink(git_path(refname));
+ return unlink(git_path("%s", refname));
item = string_list_append(refname, branches->branches);
item->util = xmalloc(20);
diff --git a/bundle.c b/bundle.c
index 7d17a1fde16204859849aaf28945739aaa685f91..daecd8e1cad4a301e2faa3888c561746d029f09d 100644 (file)
--- a/bundle.c
+++ b/bundle.c
continue;
}
if (++ret == 1)
- error(message);
+ error("%s", message);
error("%s %s", sha1_to_hex(e->sha1), e->name);
}
if (revs.pending.nr != p->nr)
for (i = 0; i < req_nr; i++)
if (!(refs.objects[i].item->flags & SHOWN)) {
if (++ret == 1)
- error(message);
+ error("%s", message);
error("%s %s", sha1_to_hex(refs.objects[i].item->sha1),
refs.objects[i].name);
}
diff --git a/environment.c b/environment.c
index df4f03a95f0b2098e97d0410bbb0589ff887e9cb..9ebf485a738740fe6ad0ebaa5c5bf4695ee527ef 100644 (file)
--- a/environment.c
+++ b/environment.c
work_tree = git_work_tree_cfg;
/* make_absolute_path also normalizes the path */
if (work_tree && !is_absolute_path(work_tree))
- work_tree = xstrdup(make_absolute_path(git_path(work_tree)));
+ work_tree = xstrdup(make_absolute_path(git_path("%s", work_tree)));
} else if (work_tree)
work_tree = xstrdup(make_absolute_path(work_tree));
git_work_tree_initialized = 1;
index 797e3178ae279f444d2efa7e3758652ad0898dd7..ab64c18a2baf5e88de8e98d9d8526ba3a7dfed14 100644 (file)
--- a/fsck.c
+++ b/fsck.c
die("this should not happen, your snprintf is broken");
}
- error(sb.buf);
+ error("%s", sb.buf);
strbuf_release(&sb);
return 1;
}
index 706351197fc26efa10c4666d38433f8fbdf1d6b5..13c18ff6529f437e6aea2671ab0003d4fd047ac7 100644 (file)
--- a/grep.c
+++ b/grep.c
if (from <= last_shown)
from = last_shown + 1;
if (last_shown && from != last_shown + 1)
- printf(hunk_mark);
+ fputs(hunk_mark, stdout);
while (from < lno) {
pcl = &prev[lno-from-1];
show_line(opt, pcl->bol, pcl->eol,
last_shown = lno-1;
}
if (last_shown && lno != last_shown + 1)
- printf(hunk_mark);
+ fputs(hunk_mark, stdout);
if (!opt->count)
show_line(opt, bol, eol, name, lno, ':');
last_shown = last_hit = lno;
* we need to show this line.
*/
if (last_shown && lno != last_shown + 1)
- printf(hunk_mark);
+ fputs(hunk_mark, stdout);
show_line(opt, bol, eol, name, lno, '-');
last_shown = lno;
}
index eb24017535f944a2c5dbc46663c02937cff69cd3..a074aea64921eb1fb90f079ede9087e6b8109f6a 100644 (file)
--- a/path.c
+++ b/path.c
len = vsnprintf(buf, n, fmt, args);
va_end(args);
if (len >= n) {
- snprintf(buf, n, bad_path);
+ strlcpy(buf, bad_path, n);
return buf;
}
return cleanup_path(buf);
goto bad;
return cleanup_path(buf);
bad:
- snprintf(buf, n, bad_path);
+ strlcpy(buf, bad_path, n);
return buf;
}
index 293389e7641a8d4ec948f21407de3f69eacbdddd..be095cb07d23ca9f0e20d2cc46df33827a123274 100644 (file)
--- a/refs.c
+++ b/refs.c
lock->lk->filename[i] = 0;
path = lock->lk->filename;
} else {
- path = git_path(refname);
+ path = git_path("%s", refname);
}
err = unlink(path);
if (err && errno != ENOENT) {
diff --git a/unpack-trees.c b/unpack-trees.c
index e5749ef638b4a9a490894d9d4fc5876d904ab9ac..54f301da67be879c80426bc21776427fdd38c02e 100644 (file)
--- a/unpack-trees.c
+++ b/unpack-trees.c
discard_index(&o->result);
if (!o->gently) {
if (message)
- return error(message);
+ return error("%s", message);
return -1;
}
return -1;