summaryrefslogtreecommitdiff
path: root/hostfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'hostfile.c')
-rw-r--r--hostfile.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/hostfile.c b/hostfile.c
index e1f826bdd..96ab880d4 100644
--- a/hostfile.c
+++ b/hostfile.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: hostfile.c,v 1.73 2018/07/16 03:09:13 djm Exp $ */ 1/* $OpenBSD: hostfile.c,v 1.76 2019/07/07 01:05:00 dtucker Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -49,7 +49,6 @@
49#include <stdio.h> 49#include <stdio.h>
50#include <stdlib.h> 50#include <stdlib.h>
51#include <string.h> 51#include <string.h>
52#include <stdarg.h>
53#include <unistd.h> 52#include <unistd.h>
54 53
55#include "xmalloc.h" 54#include "xmalloc.h"
@@ -163,13 +162,12 @@ int
163hostfile_read_key(char **cpp, u_int *bitsp, struct sshkey *ret) 162hostfile_read_key(char **cpp, u_int *bitsp, struct sshkey *ret)
164{ 163{
165 char *cp; 164 char *cp;
166 int r;
167 165
168 /* Skip leading whitespace. */ 166 /* Skip leading whitespace. */
169 for (cp = *cpp; *cp == ' ' || *cp == '\t'; cp++) 167 for (cp = *cpp; *cp == ' ' || *cp == '\t'; cp++)
170 ; 168 ;
171 169
172 if ((r = sshkey_read(ret, &cp)) != 0) 170 if (sshkey_read(ret, &cp) != 0)
173 return 0; 171 return 0;
174 172
175 /* Skip trailing whitespace. */ 173 /* Skip trailing whitespace. */
@@ -545,8 +543,8 @@ hostfile_replace_entries(const char *filename, const char *host, const char *ip,
545 /* 543 /*
546 * Prepare temporary file for in-place deletion. 544 * Prepare temporary file for in-place deletion.
547 */ 545 */
548 if ((r = asprintf(&temp, "%s.XXXXXXXXXXX", filename)) < 0 || 546 if ((r = asprintf(&temp, "%s.XXXXXXXXXXX", filename)) == -1 ||
549 (r = asprintf(&back, "%s.old", filename)) < 0) { 547 (r = asprintf(&back, "%s.old", filename)) == -1) {
550 r = SSH_ERR_ALLOC_FAIL; 548 r = SSH_ERR_ALLOC_FAIL;
551 goto fail; 549 goto fail;
552 } 550 }