Skip to content

Commit

Permalink
core: ut - fix misleading indentation for IF blocks
Browse files Browse the repository at this point in the history
- reported by latest gcc on debian sid

(cherry picked from commit b7aa4b2)
  • Loading branch information
miconda committed Oct 10, 2016
1 parent 11971cb commit c0f4284
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions ut.c
Expand Up @@ -47,7 +47,7 @@ int user2uid(int* uid, int* gid, char* user)
{
char* tmp;
struct passwd *pw_entry;

if (user){
*uid=strtol(user, &tmp, 10);
if ((tmp==0) ||(*tmp)){
Expand All @@ -73,7 +73,7 @@ int group2gid(int* gid, char* group)
{
char* tmp;
struct group *gr_entry;

if (group){
*gid=strtol(group, &tmp, 10);
if ((tmp==0) ||(*tmp)){
Expand All @@ -93,7 +93,7 @@ int group2gid(int* gid, char* group)

/*
* Replacement of timegm (does not exists on all platforms
* Taken from
* Taken from
* http://lists.samba.org/archive/samba-technical/2002-November/025737.html
*/
time_t _timegm(struct tm* t)
Expand All @@ -111,7 +111,7 @@ time_t _timegm(struct tm* t)
}
tl += 3600;
}

tg = gmtime(&tl);
tg->tm_isdst = 0;
tb = mktime(tg);
Expand Down Expand Up @@ -173,7 +173,7 @@ char* as_asciiz(str* s)
/* return system version (major.minor.minor2) as
* (major<<16)|(minor)<<8|(minor2)
* (if some of them are missing, they are set to 0)
* if the parameters are not null they are set to the coresp. part
* if the parameters are not null they are set to the coresp. part
*/
unsigned int get_sys_version(int* major, int* minor, int* minor2)
{
Expand All @@ -182,7 +182,7 @@ unsigned int get_sys_version(int* major, int* minor, int* minor2)
int m2;
int m3;
char* p;

memset (&un, 0, sizeof(un));
m1=m2=m3=0;
/* get sys version */
Expand Down Expand Up @@ -218,24 +218,24 @@ char* get_abs_pathname(str* base, str* file)
str ser_cfg;
char* buf, *dir, *res;
int len;

if (base == NULL) {
ser_cfg.s = cfg_file;
ser_cfg.len = strlen(cfg_file);
base = &ser_cfg;
}

if (!base->s || base->len <= 0 || base->s[0] != '/') {
BUG("get_abs_pathname: Base file must be absolute pathname: "
"'%.*s'\n", STR_FMT(base));
return NULL;
}

if (!file || !file->s || file->len <= 0) {
BUG("get_abs_pathname: Invalid 'file' parameter\n");
return NULL;
}

if (file->s[0] == '/') {
/* This is an absolute pathname, make a zero terminated
* copy and use it as it is */
Expand All @@ -257,7 +257,7 @@ char* get_abs_pathname(str* base, str* file)
memcpy(buf, base->s, base->len);
buf[base->len]=0;
dir = dirname(buf);

len = strlen(dir);
if ((res = pkg_malloc(len + 1 + file->len + 1)) == NULL) {
ERR("get_abs_pathname: No memory left (pkg_malloc failed)\n");
Expand Down Expand Up @@ -321,7 +321,7 @@ void * ser_memmem(const void *b1, const void *b2, size_t len1, size_t len2)
if (memcmp(sp, pp, len2) == 0)
return sp;

sp++;
sp++;
}

return NULL;
Expand Down Expand Up @@ -352,7 +352,7 @@ void * ser_memrmem(const void *b1, const void *b2, size_t len1, size_t len2)
if (memcmp(sp, pp, len2) == 0)
return sp;

sp--;
sp--;
}

return NULL;
Expand Down

0 comments on commit c0f4284

Please sign in to comment.