X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=sbr%2Fm_mktemp.c;h=c08f614e1fc5c25c4eb685df5b356b9c1a851e3c;hb=57cd23b8807fa351800ba7277c5636a133241166;hp=59ee37d1fe02157dcdc548c6c7b791f8abde3208;hpb=b7c348e99fa223f370ebdb4fd9b6627596c66a08;p=mmh diff --git a/sbr/m_mktemp.c b/sbr/m_mktemp.c index 59ee37d..c08f614 100644 --- a/sbr/m_mktemp.c +++ b/sbr/m_mktemp.c @@ -1,8 +1,6 @@ /* * m_mktemp.c -- Construct a temporary file. * - * $Id$ - * * This code is Copyright (c) 2010, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. @@ -123,7 +121,7 @@ m_mktemp2 ( /* No directory component */ return m_mktemp(pfx_in, fd_ret, fp_ret); } - n = (int)(cp-dir_in-1); /* Length of dir component */ + n = (int)(cp-dir_in); /* Length of dir component */ snprintf(buffer, sizeof(buffer), "%.*s%s", n, dir_in, pfx_in); return m_mktemp(buffer, fd_ret, fp_ret); } @@ -132,7 +130,7 @@ m_mktemp2 ( static char * get_temp_dir() { - // Ignore envvars if we are setuid + /* Ignore envvars if we are setuid */ if ((getuid()==geteuid()) && (getgid()==getegid())) { char *tmpdir = NULL; tmpdir = getenv("MHTMPDIR");