From 5f6791666943fb22e36717050383414136e5e9fc Mon Sep 17 00:00:00 2001 From: "mdm@chromium.org" Date: Thu, 24 Sep 2009 20:07:53 +0000 Subject: Linux: fix a process name setting bug that doesn't currently affect us. We don't pass a format string starting with '-' to setproctitle(), but I was looking at doing that and found this small bug. BUG=none TEST=none Review URL: http://codereview.chromium.org/218033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27114 0039d316-1c4b-4281-b951-d872f2087c98 --- base/setproctitle_linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'base') diff --git a/base/setproctitle_linux.c b/base/setproctitle_linux.c index 205be2b..3544d3e 100644 --- a/base/setproctitle_linux.c +++ b/base/setproctitle_linux.c @@ -91,7 +91,7 @@ void setproctitle(const char* fmt, ...) { memset(g_main_argv[0], 0, avail_size); va_start(ap, fmt); if (fmt[0] == '-') { - vsnprintf(g_main_argv[0], avail_size, fmt, ap); + vsnprintf(g_main_argv[0], avail_size, &fmt[1], ap); } else { size_t size = snprintf(g_main_argv[0], avail_size, "%s ", g_orig_argv0); if (size < avail_size) -- cgit v1.1