Skip to content

Commit

Permalink
Fix compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasAdam committed Apr 14, 2019
1 parent 2d28582 commit be56d14
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
6 changes: 2 additions & 4 deletions fvwm/add_window.c
Expand Up @@ -575,9 +575,7 @@ static char *interpolate_titleformat_name(
const char *format;
int count;

/* MAX_WINDOW_NAME_NUMBER is defined as "999" -- that's three
* characters maximum. win_name_len must be 1 larger for null.
*/
char no_of_wins[4096];
char win_name_len[MAX_WINDOW_NAME_NUMBER_DIGITS+1];
char w_id[12];

Expand Down Expand Up @@ -690,7 +688,7 @@ static char *interpolate_titleformat_name(
if (count > (MAX_WINDOW_NAME_NUMBER - 1))
count = MAX_WINDOW_NAME_NUMBER - 1;

sprintf(win_name_len, "%d", ++count);
sprintf(no_of_wins, "%d", ++count);
strcat(stringbuf, win_name_len);
break;
case 'I':
Expand Down
7 changes: 5 additions & 2 deletions libs/FBidi.c
Expand Up @@ -51,7 +51,7 @@ char *FBidiConvert(
FriBidiChar *visual_unicode_str;
FriBidiParType pbase_dir = FRIBIDI_TYPE_ON;
FriBidiStrIndex *pos_l_to_v;
int i;
int i, loglevel;

if (logical_str == NULL || charset == NULL)
{
Expand Down Expand Up @@ -86,10 +86,13 @@ char *FBidiConvert(
/* also keep track of how characters are reordered here, to reorder
combing characters accordingly */
pos_l_to_v = xmalloc((str_len + 1) * sizeof(FriBidiStrIndex));
fribidi_log2vis(
loglevel = fribidi_log2vis(
logical_unicode_str, str_len, &pbase_dir,
visual_unicode_str, pos_l_to_v, NULL, NULL);

if (loglevel == 0)
return (NULL);

/* remap mapping from logical to visual to "compensate" for BIDI */
if (comb_chars != NULL)
{
Expand Down
2 changes: 1 addition & 1 deletion modules/FvwmScript/FvwmScript.c
Expand Up @@ -1326,7 +1326,7 @@ void ReadFvwmScriptArg(int argc, char **argv,int IsFather)
{ /* Cas du fils */
x11base->TabScriptId[0] = xcalloc(sizeof(char), strlen(argv[7]));
x11base->TabScriptId[0] = strncpy(x11base->TabScriptId[0],argv[7],
strlen(argv[7])-2);
sizeof(x11base->TabScriptId));
x11base->TabScriptId[1] = argv[7];
myatom=XInternAtom(dpy, x11base->TabScriptId[1], True);
XSetSelectionOwner(dpy, myatom, x11base->win, CurrentTime);
Expand Down
2 changes: 1 addition & 1 deletion modules/FvwmScript/Instructions.c
Expand Up @@ -360,7 +360,7 @@ static char *FuncGetOutput(int *NbArg, long *TabArg)
n = fread(BufCom,1,maxsize,f);
(void)n;
pclose(f);
strncpy(Command,cmndbuf,255);
strncpy(Command,cmndbuf,sizeof(Command));
TimeCom=time(NULL);
}
}
Expand Down

0 comments on commit be56d14

Please sign in to comment.