From: Jeff Moyer Subject: Re: [PATCH] More autofs cleanup Date: Mon, 14 Aug 2006 08:17:03 -0400 Message-ID: References: <20060811023733.GC26249@mail.iSKUNK.ORG> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20060811023733.GC26249@mail.iSKUNK.ORG> (Daniel Richard G.'s message of "Thu, 10 Aug 2006 22:37:33 -0400") List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: autofs-bounces@linux.kernel.org Errors-To: autofs-bounces@linux.kernel.org To: "Daniel Richard G." Cc: autofs@linux.kernel.org ==> Regarding [autofs] [PATCH] More autofs cleanup; "Daniel Richard G." adds: skunk> Hello list, Finally built and semi-figured-out git. A few more skunk> wrinkles ironed out in this patch. skunk> modules/lookup_hosts.c: skunk> * Fixed more weirdness of using sprintf()'s return value. @@ -170,10 +172,10 @@ int lookup_mount(struct autofs_point *ap */ if (*name == '/') { pthread_cleanup_push(cache_lock_cleanup, mc); - mapent = alloca(strlen(me->mapent) + 1); - mapent_len = sprintf(mapent, me->mapent); + mapent_len = strlen(me->mapent); + mapent = alloca(mapent_len + 1); + strcpy(mapent, me->mapent); pthread_cleanup_pop(0); - mapent[mapent_len] = '\0'; } done: cache_unlock(mc); This is just a refactoring of code with no real gain. The previous usage was correct. As Ian mentioned before, posting patches inline makes it easier to quote in the reply (at least for my arcane mailer. ;). The rest up to this point looks pretty good to me. Thanks a bunch for doing this! -Jeff