Browse Source

fix gcc-11.0 warnings

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Denys Vlasenko 3 years ago
parent
commit
fe2d8065e3
4 changed files with 4 additions and 4 deletions
  1. 1 1
      include/libbb.h
  2. 1 1
      libbb/lineedit.c
  3. 1 1
      libbb/xfuncs_printf.c
  4. 1 1
      networking/udhcp/signalpipe.c

+ 1 - 1
include/libbb.h

@@ -623,7 +623,7 @@ uoff_t FAST_FUNC get_volume_size_in_bytes(int fd,
 		unsigned override_units,
 		int extend);
 
-void xpipe(int filedes[2]) FAST_FUNC;
+void xpipe(int *filedes) FAST_FUNC;
 /* In this form code with pipes is much more readable */
 struct fd_pair { int rd; int wr; };
 #define piped_pair(pair)  pipe(&((pair).rd))

+ 1 - 1
libbb/lineedit.c

@@ -1314,7 +1314,7 @@ static NOINLINE void input_tab(smallint *lastWasTab)
 			strcpy(&command[cursor_mb], chosen_match + match_pfx_len);
 			len = load_string(command);
 			/* add match and tail */
-			sprintf(&command[cursor_mb], "%s%s", chosen_match + match_pfx_len, match_buf);
+			stpcpy(stpcpy(&command[cursor_mb], chosen_match + match_pfx_len), match_buf);
 			command_len = load_string(command);
 			/* write out the matched command */
 			/* paranoia: load_string can return 0 on conv error,

+ 1 - 1
libbb/xfuncs_printf.c

@@ -224,7 +224,7 @@ int FAST_FUNC rename_or_warn(const char *oldpath, const char *newpath)
 	return n;
 }
 
-void FAST_FUNC xpipe(int filedes[2])
+void FAST_FUNC xpipe(int *filedes)
 {
 	if (pipe(filedes))
 		bb_simple_perror_msg_and_die("can't create pipe");

+ 1 - 1
networking/udhcp/signalpipe.c

@@ -65,7 +65,7 @@ void FAST_FUNC udhcp_sp_setup(void)
 /* Quick little function to setup the pfds.
  * Limited in that you can only pass one extra fd.
  */
-void FAST_FUNC udhcp_sp_fd_set(struct pollfd pfds[2], int extra_fd)
+void FAST_FUNC udhcp_sp_fd_set(struct pollfd *pfds, int extra_fd)
 {
 	pfds[0].fd = READ_FD;
 	pfds[0].events = POLLIN;