Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

fixed build error: variable ‘ret’ set but not used #4

Merged
merged 1 commit into from

2 participants

@arnaud-lb

This fixes a variable ‘ret’ set but not used under gcc 4.7.1:

ketama.c: In function ‘read_server_definitions’:
ketama.c:273:12: error: variable ‘ret’ set but not used [-Werror=unused-but-set-variable]
@RJ RJ merged commit 175733d into from
@RJ
Owner
RJ commented

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 13, 2012
  1. @arnaud-lb
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 2 deletions.
  1. +3 −2 libketama/ketama.c
View
5 libketama/ketama.c
@@ -270,14 +270,15 @@ read_server_definitions( char* filename, unsigned int* count, unsigned long* mem
unsigned int lineno = 0;
unsigned int numservers = 0;
unsigned long memtotal = 0;
- char * ret;
FILE* fi = fopen( filename, "r" );
while ( fi && !feof( fi ) )
{
char sline[128] = "";
- ret = fgets( sline, 127, fi );
+ if (fgets( sline, 127, fi ) == NULL)
+ continue;
+
lineno++;
if ( strlen( sline ) < 2 || sline[0] == '#' )
Something went wrong with that request. Please try again.