mailing list of musl libc
 help / color / mirror / code / Atom feed
1dd342393b30007f290362d60cfe08686f060679 blob 772 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
 
#include "pwf.h"

static long xatol(char **s)
{
	long x;
	if (**s == ':' || **s == '\n') return -1;
	for (x=0; **s-'0'<10U; ++*s) x=10*x+(**s-'0');
	return x;
}

int __parsespent(char *s, struct spwd *sp)
{
	sp->sp_namp = s;
	if (!(s = strchr(s, ':'))) return -1;
	*s = 0;

	sp->sp_pwdp = ++s;
	if (!(s = strchr(s, ':'))) return -1;
	*s = 0;

	s++; sp->sp_lstchg = xatol(&s);
	if (*s != ':') return -1;

	s++; sp->sp_min = xatol(&s);
	if (*s != ':') return -1;

	s++; sp->sp_max = xatol(&s);
	if (*s != ':') return -1;

	s++; sp->sp_warn = xatol(&s);
	if (*s != ':') return -1;

	s++; sp->sp_inact = xatol(&s);
	if (*s != ':') return -1;

	s++; sp->sp_expire = xatol(&s);
	if (*s != ':') return -1;

	s++; sp->sp_flag = xatol(&s);
	if (*s != '\n') return -1;
	return 0;
}
debug log:

solving d781387 ...
found d781387 in https://inbox.vuxu.org/musl/1385003621-10289-2-git-send-email-mforney@mforney.org/

applying [1/1] https://inbox.vuxu.org/musl/1385003621-10289-2-git-send-email-mforney@mforney.org/
diff --git a/src/passwd/parsespent.c b/src/passwd/parsespent.c
new file mode 100644
index 0000000..d781387

Checking patch src/passwd/parsespent.c...
Applied patch src/passwd/parsespent.c cleanly.

index at:
100644 1dd342393b30007f290362d60cfe08686f060679	src/passwd/parsespent.c

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).