toolbox

Check-in [59aa81acb3]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:lib: use explicit error code
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 59aa81acb3c8501c1309b284e32e253e4ac686ddc4219c68513b488573d2bd49
User & Date: jef 2019-02-25 09:04:25
Context
2019-03-23
11:38
rss: feeds_refresh() reduce db usage check-in: 96a9e17c2e user: jef tags: trunk
2019-02-25
09:04
lib: use explicit error code check-in: 59aa81acb3 user: jef tags: trunk
2019-02-24
19:37
lib: make Makefile openbsd compatible check-in: 50551a9e8c user: jef tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/lib/die.c.

11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
..
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
	char *fmt2;
	va_list argp;

	va_start(argp, fmt);
	if (fmt[0] && fmt[strlen(fmt) - 1] == ':') {
		fmt2 = strdup(fmt);
		if (fmt2 == NULL)
			err(1, "strdup error");
		fmt2[strlen(fmt2) - 1] = '\0';
		vwarn(fmt2, argp);
		free(fmt2);
	} else {
		vwarnx(fmt, argp);
	}
	va_end(argp);
................................................................................
	char *fmt2;
	va_list argp;

	va_start(argp, fmt);
	if (fmt[0] && fmt[strlen(fmt) - 1] == ':') {
		fmt2 = strdup(fmt);
		if (fmt2 == NULL)
			err(1, "strdup error");
		fmt2[strlen(fmt2) - 1] = '\0';
		verr(EXIT_FAILURE, fmt2, argp);
	} else {
		verrx(EXIT_FAILURE, fmt, argp);
	}
	va_end(argp);
}







|







 







|







11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
..
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
	char *fmt2;
	va_list argp;

	va_start(argp, fmt);
	if (fmt[0] && fmt[strlen(fmt) - 1] == ':') {
		fmt2 = strdup(fmt);
		if (fmt2 == NULL)
			err(EXIT_FAILURE, "strdup error");
		fmt2[strlen(fmt2) - 1] = '\0';
		vwarn(fmt2, argp);
		free(fmt2);
	} else {
		vwarnx(fmt, argp);
	}
	va_end(argp);
................................................................................
	char *fmt2;
	va_list argp;

	va_start(argp, fmt);
	if (fmt[0] && fmt[strlen(fmt) - 1] == ':') {
		fmt2 = strdup(fmt);
		if (fmt2 == NULL)
			err(EXIT_FAILURE, "strdup error");
		fmt2[strlen(fmt2) - 1] = '\0';
		verr(EXIT_FAILURE, fmt2, argp);
	} else {
		verrx(EXIT_FAILURE, fmt, argp);
	}
	va_end(argp);
}