toolbox

Check-in [bddff63dab]
Login

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

Overview
Comment:townsign: add check on write() call
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: bddff63dabad4505b9aa2de209184fecfe1de541109a9a89c7762db521273a96
User & Date: jef 2019-08-23 18:49:15
Context
2019-08-23
19:08
townsign: unlink town file properly check-in: f160722ec0 user: jef tags: trunk
18:49
townsign: add check on write() call check-in: bddff63dab user: jef tags: trunk
18:44
townsign: add scale factor and country road number check-in: 74db56ab65 user: jef tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/townsign/townsign.c.

94
95
96
97
98
99
100
101
102


103
104
105
106
107
108
109
	int fd;
	char buff[4096];
	ssize_t nread;

	fd = open(file, O_RDONLY);
	if (fd == -1)
		die("catfile error");
	while ((nread = read(fd, buff, sizeof(buff))) > 0)
		write(1, buff, nread);


	close(fd);
}

char *
font_file()
{
	char *filename;







|
|
>
>







94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
	int fd;
	char buff[4096];
	ssize_t nread;

	fd = open(file, O_RDONLY);
	if (fd == -1)
		die("catfile error");
	while ((nread = read(fd, buff, sizeof(buff))) > 0) {
		if (write(1, buff, nread) < nread)
			die("write error");
	}
	close(fd);
}

char *
font_file()
{
	char *filename;