From: David Tweed Date: Wed, 06 Feb 2008 18:59:15 GMT Subject: Re: [PATCH] Make git prune remove temporary packs that look like write failures Message-ID: In-Reply-To: <47A9E4F9.8050100@nrlssc.navy.mil> On Feb 6, 2008 4:48 PM, Brandon Casey wrote: > I also suggest taking a look at the functions in builtin-prune-packed.c to see > how similar functions are implemented there. > > Use strlcpy instead of sprintf. > Use prefixcmp instead of strncmp. > Use same messages as prune_dir() for show_only path and unlink failure. > You could also check the opendir call and print a suitable message on failure. All the other path creation in builtin-prune.c is using sprintf; is doing 3 strlcpy's much better? (I backed off from using snprintf when the other element in the if that tested it vanished; I probably ought to put that back.) I'll use prefixcmp and check the opendir call (although if get_object_directory() doesn't return something sensible presumably bigger problems are in the mix.) -- cheers, dave tweed__________________________ david.tweed@gmail.com Rm 124, School of Systems Engineering, University of Reading. "while having code so boring anyone can maintain it, use Python." -- attempted insult seen on slashdot