Skip to content

Commit

Permalink
dispatcher: fix compiler warning #612
Browse files Browse the repository at this point in the history
> CC (gcc) [M dispatcher.so]      dispatch.o
> dispatch.c: In function 'ds_set_attrs':
> dispatch.c:263:8: warning: 'tmp_rweight' may be used uninitialized in this function [-Wmaybe-uninitialized]
>     int tmp_rweight;
>         ^
> make[3]: 'libkmi.so.1.0' is up to date.
  • Loading branch information
linuxmaniac committed May 13, 2016
1 parent c7c8d31 commit 6dd4b1f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/dispatcher/dispatch.c
Expand Up @@ -225,6 +225,7 @@ int ds_set_attrs(ds_dest_t *dest, str *attrs)
param_hooks_t phooks;
param_t *pit=NULL;
str param;
int tmp_rweight = 0;

if(attrs==NULL || attrs->len<=0)
return 0;
Expand Down Expand Up @@ -260,7 +261,7 @@ int ds_set_attrs(ds_dest_t *dest, str *attrs)
dest->attrs.socket = pit->body;
}else if(pit->name.len==7
&& strncasecmp(pit->name.s, "rweight", 7)==0) {
int tmp_rweight;
tmp_rweight = 0;
str2sint(&pit->body, &tmp_rweight);
if ( tmp_rweight>=1 && tmp_rweight<=100 ) {
dest->attrs.rweight = tmp_rweight;
Expand Down

0 comments on commit 6dd4b1f

Please sign in to comment.