Welcome to little lamb

Code » limb » release » tree

[release] / src / liblimb / djbunix.h / rmstar_tmpat.c

/* This file is part of limb                           https://lila.oss/limb
 * Copyright (C) 2023 Olivier Brunel                          jjk@jjacky.com */
/* SPDX-License-Identifier: GPL-2.0-only */
#include <limb/djbunix.h>

int
rmstar_tmpat(int fd, const char *name, stralloc *sa)
{
    size_t salen = sa->len;
    int ret = 0;

    if (!stralloc_cats(sa, name) || !stralloc_0(sa)
            || rmstar_in_tmpat(fd, sa, salen) < 0)
        ret = -1;

    sa->len = salen;
    return ret;
}