From kde-commits Tue Oct 09 11:03:03 2012 From: Pino Toscano Date: Tue, 09 Oct 2012 11:03:03 +0000 To: kde-commits Subject: icecream/daemon Message-Id: <20121009110303.91E83AC84E () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=134978059414117 SVN commit 1319788 by pino: shorten prefix_output to the required size just use 32 characters for prefix_output, which are more than the required for the string, instead of misuse PATH_MAX (which would waste 4kb on Linux (and others) systems) M +1 -1 serve.cpp --- trunk/icecream/daemon/serve.cpp #1319787:1319788 @@ -139,7 +139,7 @@ memset(job_stat, 0, sizeof(job_stat)); char tmp_output[PATH_MAX]; - char prefix_output[PATH_MAX]; // I'm too lazy to calculate how many digits 2^64 is :) + char prefix_output[32]; // 20 for 2^64 + 6 for "icecc-" + 1 for trailing NULL sprintf( prefix_output, "icecc-%d", job_id ); if ( ( ret = dcc_make_tmpnam(prefix_output, ".o", tmp_output, 1 ) ) == 0 ) {