wsutil: Check return from ws_write

Change-Id: I73f65222dc23ebcb484f2598a12f43b284654420
Reviewed-on: https://code.wireshark.org/review/22321
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
This commit is contained in:
Stig Bjørlykke 2017-06-21 16:09:15 -04:00
parent 6e0bc30a95
commit 6117ff496b
1 changed files with 3 additions and 2 deletions

View File

@ -1249,6 +1249,7 @@ profile_write_info_file(void)
{
gchar *profile_dir, *info_file, *filename;
GList *files, *file;
ssize_t nwritten = 0;
int fd;
profile_dir = get_profiles_dir();
@ -1260,8 +1261,8 @@ profile_write_info_file(void)
file = g_list_first(files);
while (file) {
filename = (gchar *)file->data;
(void)ws_write(fd, filename, (unsigned int)strlen(filename));
(void)ws_write(fd, "\n", 1);
nwritten += ws_write(fd, filename, (unsigned int)strlen(filename));
nwritten += ws_write(fd, "\n", 1);
file = g_list_next(file);
}
g_list_free(files);