use more safe functions and update #inlcude
This commit is contained in:
parent
7064e17726
commit
9f56ade4e9
|
@ -3,7 +3,6 @@
|
|||
#include <errno.h>
|
||||
#include <locale.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/select.h>
|
||||
#include <X11/cursorfont.h>
|
||||
|
@ -13,7 +12,6 @@
|
|||
#include <X11/Xutil.h>
|
||||
|
||||
#include "awesome.h"
|
||||
#include "util.h"
|
||||
#include "event.h"
|
||||
#include "layout.h"
|
||||
#include "tag.h"
|
||||
|
@ -345,7 +343,7 @@ main(int argc, char *argv[])
|
|||
readin = False;
|
||||
break;
|
||||
default:
|
||||
for(awesomeconf.statustext[r] = '\0', p = awesomeconf.statustext + strlen(awesomeconf.statustext) - 1;
|
||||
for(awesomeconf.statustext[r] = '\0', p = awesomeconf.statustext + a_strlen(awesomeconf.statustext) - 1;
|
||||
p >= awesomeconf.statustext && *p == '\n'; *p-- = '\0');
|
||||
for(; p >= awesomeconf.statustext && *p != '\n'; --p);
|
||||
if(p > awesomeconf.statustext)
|
||||
|
|
2
client.c
2
client.c
|
@ -1,12 +1,10 @@
|
|||
/* See LICENSE file for copyright and license details. */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <X11/Xatom.h>
|
||||
#include <X11/Xutil.h>
|
||||
|
||||
#include "awesome.h"
|
||||
#include "util.h"
|
||||
#include "layout.h"
|
||||
#include "tag.h"
|
||||
|
||||
|
|
2
config.c
2
config.c
|
@ -4,12 +4,10 @@
|
|||
* \defgroup ui_callback
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <libconfig.h>
|
||||
#include <X11/keysym.h>
|
||||
|
||||
#include "awesome.h"
|
||||
#include "util.h"
|
||||
#include "layout.h"
|
||||
#include "tag.h"
|
||||
#include "layouts/tile.h"
|
||||
|
|
2
draw.c
2
draw.c
|
@ -20,7 +20,7 @@ drawtext(Display *disp, const char *text, unsigned long col[ColLast])
|
|||
if(!text)
|
||||
return;
|
||||
w = 0;
|
||||
olen = len = strlen(text);
|
||||
olen = len = a_strlen(text);
|
||||
if(len >= sizeof buf)
|
||||
len = sizeof buf - 1;
|
||||
memcpy(buf, text, len);
|
||||
|
|
5
draw.h
5
draw.h
|
@ -3,10 +3,9 @@
|
|||
#ifndef AWESOME_DRAW_H
|
||||
#define AWESOME_DRAW_H
|
||||
|
||||
#include <string.h>
|
||||
#include "config.h"
|
||||
#include "util.h"
|
||||
|
||||
#define textw(text) (textnw(text, strlen(text)) + dc.font.height)
|
||||
#define textw(text) (textnw(text, a_strlen(text)) + dc.font.height)
|
||||
|
||||
void drawstatus(Display *, awesome_config *); /* draw the bar */
|
||||
unsigned int textnw(const char *, unsigned int);
|
||||
|
|
2
event.c
2
event.c
|
@ -1,11 +1,9 @@
|
|||
/* See LICENSE file for copyright and license details. */
|
||||
#include <stdlib.h>
|
||||
#include <X11/keysym.h>
|
||||
#include <X11/Xatom.h>
|
||||
#include <X11/Xutil.h>
|
||||
|
||||
#include "awesome.h"
|
||||
#include "util.h"
|
||||
#include "event.h"
|
||||
#include "layout.h"
|
||||
#include "tag.h"
|
||||
|
|
2
layout.c
2
layout.c
|
@ -1,6 +1,5 @@
|
|||
/* See LICENSE file for copyright and license details. */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <X11/Xatom.h>
|
||||
#include <X11/Xutil.h>
|
||||
|
||||
|
@ -8,7 +7,6 @@
|
|||
#include "layout.h"
|
||||
#include "tag.h"
|
||||
#include "layouts/floating.h"
|
||||
#include "util.h"
|
||||
|
||||
/* extern */
|
||||
extern int wax, way, wah, waw; /* windowarea geometry */
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
/* See LICENSE file for copyright and license details. */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "layouts/tile.h"
|
||||
#include "layout.h"
|
||||
|
|
8
tag.c
8
tag.c
|
@ -1,10 +1,8 @@
|
|||
/* See LICENSE file for copyright and license details. */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
|
||||
#include "util.h"
|
||||
#include "layout.h"
|
||||
#include "tag.h"
|
||||
|
||||
|
@ -41,11 +39,7 @@ applyrules(Client * c, awesome_config *awesomeconf)
|
|||
XClassHint ch = { 0, 0 };
|
||||
char *prop;
|
||||
|
||||
if(ch.res_class)
|
||||
len += strlen(ch.res_class);
|
||||
if(ch.res_name)
|
||||
len += strlen(ch.res_name);
|
||||
len += strlen(c->name);
|
||||
len += a_strlen(ch.res_class) + a_strlen(ch.res_name) + a_strlen(c->name);
|
||||
|
||||
prop = p_new(char, len + 1);
|
||||
|
||||
|
|
2
util.c
2
util.c
|
@ -2,10 +2,8 @@
|
|||
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/wait.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "util.h"
|
||||
|
||||
|
|
Loading…
Reference in New Issue