Skip to content

Commit 948cb7e

Browse files
committed
MAINTENANCE release build warnings
1 parent 5d55685 commit 948cb7e

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

cli/commands.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ static void
201201
cli_ntf_clb(struct nc_session *session, const struct nc_notif *notif)
202202
{
203203
FILE *output = nc_session_get_data(session);
204-
int was_rawmode;
204+
int was_rawmode = 0;
205205

206206
if (output == stdout) {
207207
if (ls.rawmode) {
@@ -504,7 +504,7 @@ static char *
504504
trim_top_elem(char *data, const char *top_elem, const char *top_elem_ns)
505505
{
506506
char *ptr, *prefix = NULL, *buf;
507-
int pref_len, state = 0, quote;
507+
int pref_len = 0, state = 0, quote;
508508

509509
/* state: -2 - syntax error,
510510
* -1 - top_elem not found,

cli/completion.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* This source code is licensed under BSD 3-Clause License (the "License").
99
* You may not use this file except in compliance with the License.
1010
* You may obtain a copy of the License at
11-
*
11+
*
1212
* https://opensource.org/licenses/BSD-3-Clause
1313
*/
1414

@@ -115,9 +115,11 @@ complete_cmd(const char *buf, const char *hint, linenoiseCompletions *lc)
115115
char *
116116
readinput(const char *instruction, const char *old_tmp, char **new_tmp)
117117
{
118-
int tmpfd = -1, ret, size, oldfd;
118+
volatile int tmpfd = -1;
119+
int ret, size, oldfd;
119120
pid_t pid, wait_pid;
120-
char* tmpname = NULL, *input = NULL, *old_content = NULL, *ptr, *ptr2;
121+
char* volatile input = NULL, * volatile old_content = NULL;
122+
char *tmpname = NULL, *ptr, *ptr2;
121123

122124
/* Create a unique temporary file */
123125
#ifdef HAVE_MKSTEMPS
@@ -226,7 +228,7 @@ readinput(const char *instruction, const char *old_tmp, char **new_tmp)
226228
lseek(tmpfd, 0, SEEK_SET);
227229

228230
/* Read the input */
229-
input = malloc(size+1);
231+
input = malloc(size + 1);
230232
ret = read(tmpfd, input, size);
231233
if (ret < size) {
232234
ERROR(__func__, "Failed to read from the temporary file (%s).", strerror(errno));
@@ -244,7 +246,7 @@ readinput(const char *instruction, const char *old_tmp, char **new_tmp)
244246
/* The user could have deleted or modified the comment, ignore it then */
245247
if (ptr2) {
246248
ptr2 += 5;
247-
memmove(ptr, ptr2, strlen(ptr2)+1);
249+
memmove(ptr, ptr2, strlen(ptr2) + 1);
248250

249251
/* Save the modified content */
250252
if (ftruncate(tmpfd, 0) == -1) {

server/log.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ void
149149
np2log_clb_nc2(NC_VERB_LEVEL level, const char *msg)
150150
{
151151
struct np2err *e;
152-
int priority;
152+
int priority = LOG_ERR;
153153

154154
if (level == NC_VERB_ERROR) {
155155
e = np2_err_location();

0 commit comments

Comments
 (0)