Skip to content

Commit

Permalink
MAINTENANCE release build warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
michalvasko committed Jun 6, 2018
1 parent 5d55685 commit 948cb7e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions cli/commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ static void
cli_ntf_clb(struct nc_session *session, const struct nc_notif *notif)
{
FILE *output = nc_session_get_data(session);
int was_rawmode;
int was_rawmode = 0;

if (output == stdout) {
if (ls.rawmode) {
Expand Down Expand Up @@ -504,7 +504,7 @@ static char *
trim_top_elem(char *data, const char *top_elem, const char *top_elem_ns)
{
char *ptr, *prefix = NULL, *buf;
int pref_len, state = 0, quote;
int pref_len = 0, state = 0, quote;

/* state: -2 - syntax error,
* -1 - top_elem not found,
Expand Down
12 changes: 7 additions & 5 deletions cli/completion.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* This source code is licensed under BSD 3-Clause License (the "License").
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* https://opensource.org/licenses/BSD-3-Clause
*/

Expand Down Expand Up @@ -115,9 +115,11 @@ complete_cmd(const char *buf, const char *hint, linenoiseCompletions *lc)
char *
readinput(const char *instruction, const char *old_tmp, char **new_tmp)
{
int tmpfd = -1, ret, size, oldfd;
volatile int tmpfd = -1;
int ret, size, oldfd;
pid_t pid, wait_pid;
char* tmpname = NULL, *input = NULL, *old_content = NULL, *ptr, *ptr2;
char* volatile input = NULL, * volatile old_content = NULL;
char *tmpname = NULL, *ptr, *ptr2;

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

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

/* Save the modified content */
if (ftruncate(tmpfd, 0) == -1) {
Expand Down
2 changes: 1 addition & 1 deletion server/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ void
np2log_clb_nc2(NC_VERB_LEVEL level, const char *msg)
{
struct np2err *e;
int priority;
int priority = LOG_ERR;

if (level == NC_VERB_ERROR) {
e = np2_err_location();
Expand Down

0 comments on commit 948cb7e

Please sign in to comment.