Skip to content

Commit

Permalink
[client] Fix compilation on windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
killing committed Oct 16, 2015
1 parent 4aefc33 commit 54e73b1
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions lib/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -1064,26 +1064,6 @@ is_uuid_valid (const char *uuid_str)
return TRUE;
}

gboolean
is_object_id_valid (const char *obj_id)
{
int len = strlen(obj_id);
int i;
char c;

if (len != 40)
return FALSE;

for (i = 0; i < len; ++i) {
c = obj_id[i];
if ((c >= '0' && c <= '9') || (c >= 'a' && c <= 'f'))
continue;
return FALSE;
}

return TRUE;
}

#else
char* gen_uuid ()
{
Expand Down Expand Up @@ -1120,6 +1100,26 @@ is_uuid_valid (const char *uuid_str)

#endif

gboolean
is_object_id_valid (const char *obj_id)
{
int len = strlen(obj_id);
int i;
char c;

if (len != 40)
return FALSE;

for (i = 0; i < len; ++i) {
c = obj_id[i];
if ((c >= '0' && c <= '9') || (c >= 'a' && c <= 'f'))
continue;
return FALSE;
}

return TRUE;
}

char** strsplit_by_space (char *string, int *length)
{
char *remainder, *s;
Expand Down

0 comments on commit 54e73b1

Please sign in to comment.