At Fri, 30 Dec 2011 21:07:00 +0800,
Liu Yuan wrote:
> 
> From: Liu Yuan <[email protected]>
> 
> Signed-off-by: Liu Yuan <[email protected]>
> ---
>  sheep/store.c |    9 ++++++++-
>  1 files changed, 8 insertions(+), 1 deletions(-)
> 
> diff --git a/sheep/store.c b/sheep/store.c
> index 0025252..201dbb5 100644
> --- a/sheep/store.c
> +++ b/sheep/store.c
> @@ -1862,7 +1862,14 @@ int init_base_path(const char *d)
>  
>  static int init_obj_path(const char *base_path)
>  {
> -     int new;
> +     int new, len;
> +
> +     len = strlen(base_path);
> +     /* farm needs extra 43 chars to store snapshot objects */
> +     if (len + 43 > PATH_MAX) {

Can you use #define instead of the magic number, and explain why it is
43 bytes?

Thanks,

Kazutaka
-- 
sheepdog mailing list
[email protected]
http://lists.wpkg.org/mailman/listinfo/sheepdog

Reply via email to