kulp / tenyr
1
#include "os_common.h"
2

3
#include <stdlib.h>
4
#include <errno.h>
5

6 1
int os_get_tsimrc_path(char buf[], size_t sz)
7
{
8 1
    char *home = getenv("HOME");
9 1
    int need = snprintf(buf, sz, "%s/.tsimrc", home);
10 1
    if ((size_t)need >= sz) {
11 0
        errno = ENOSPC;
12 0
        return 1;
13
    }
14 1
    return need < 0; // true means failure
15
}
16

Read our documentation on viewing source code .

Loading