aboutsummaryrefslogtreecommitdiffstats
path: root/kbfunc.c
diff options
context:
space:
mode:
authorokan2011-07-25 15:10:24 +0000
committerokan2011-07-25 15:10:24 +0000
commit02915d130c044aa89ceff108b868c705856a35ca (patch)
tree819b08241dca0050a75a5ec1af2cc17fb98d8382 /kbfunc.c
parent1ef8b9886258d857d0c25c9ab2f5220b4acb8065 (diff)
downloadcwm-02915d130c044aa89ceff108b868c705856a35ca.tar.gz
We are inconsistent when it comes to function returns, so just go all
the way with the cwm specific parts. ok oga@
Diffstat (limited to '')
-rw-r--r--kbfunc.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/kbfunc.c b/kbfunc.c
index ba34a77..ced4081 100644
--- a/kbfunc.c
+++ b/kbfunc.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: kbfunc.c,v 1.56 2011/07/23 13:09:11 okan Exp $
+ * $OpenBSD: kbfunc.c,v 1.57 2011/07/25 15:10:24 okan Exp $
*/
#include <sys/param.h>
@@ -157,7 +157,7 @@ kbfunc_client_search(struct client_ctx *cc, union arg *arg)
TAILQ_FOREACH(cc, &Clientq, entry) {
mi = xcalloc(1, sizeof(*mi));
- strlcpy(mi->text, cc->name, sizeof(mi->text));
+ (void)strlcpy(mi->text, cc->name, sizeof(mi->text));
mi->ctx = cc;
TAILQ_INSERT_TAIL(&menuq, mi, entry);
}
@@ -192,7 +192,7 @@ kbfunc_menu_search(struct client_ctx *cc, union arg *arg)
TAILQ_FOREACH(cmd, &Conf.cmdq, entry) {
mi = xcalloc(1, sizeof(*mi));
- strlcpy(mi->text, cmd->label, sizeof(mi->text));
+ (void)strlcpy(mi->text, cmd->label, sizeof(mi->text));
mi->ctx = cmd;
TAILQ_INSERT_TAIL(&menuq, mi, entry);
}
@@ -291,7 +291,7 @@ kbfunc_exec(struct client_ctx *cc, union arg *arg)
/* skip everything but regular files and symlinks */
if (dp->d_type != DT_REG && dp->d_type != DT_LNK)
continue;
- memset(tpath, '\0', sizeof(tpath));
+ (void)memset(tpath, '\0', sizeof(tpath));
l = snprintf(tpath, sizeof(tpath), "%s/%s", paths[i],
dp->d_name);
/* check for truncation etc */
@@ -299,7 +299,8 @@ kbfunc_exec(struct client_ctx *cc, union arg *arg)
continue;
if (access(tpath, X_OK) == 0) {
mi = xcalloc(1, sizeof(*mi));
- strlcpy(mi->text, dp->d_name, sizeof(mi->text));
+ (void)strlcpy(mi->text,
+ dp->d_name, sizeof(mi->text));
TAILQ_INSERT_TAIL(&menuq, mi, entry);
}
}
@@ -366,7 +367,7 @@ kbfunc_ssh(struct client_ctx *cc, union arg *arg)
else {
/* EOF without EOL, copy and add the NUL */
lbuf = xmalloc(len + 1);
- memcpy(lbuf, buf, len);
+ (void)memcpy(lbuf, buf, len);
lbuf[len] = '\0';
buf = lbuf;
}
@@ -379,13 +380,13 @@ kbfunc_ssh(struct client_ctx *cc, union arg *arg)
/* ignore badness */
if (p - buf + 1 > sizeof(hostbuf))
continue;
- (void) strlcpy(hostbuf, buf, p - buf + 1);
+ (void)strlcpy(hostbuf, buf, p - buf + 1);
mi = xcalloc(1, sizeof(*mi));
- (void) strlcpy(mi->text, hostbuf, sizeof(mi->text));
+ (void)strlcpy(mi->text, hostbuf, sizeof(mi->text));
TAILQ_INSERT_TAIL(&menuq, mi, entry);
}
xfree(lbuf);
- fclose(fp);
+ (void)fclose(fp);
if ((mi = menu_filter(sc, &menuq, "ssh", NULL, 1,
search_match_exec, NULL)) != NULL) {