/*
* Utility routines.
*
- * Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org>
+ * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
#include <stdio.h>
#include <string.h>
-#include "pwd.h"
-#include "grp.h"
#include "libbb.h"
+#include "pwd_.h"
+#include "grp_.h"
/* gets a groupname given a gid */
-void my_getgrgid(char *group, long gid)
+char * my_getgrgid(char *group, long gid)
{
struct group *mygroup;
mygroup = getgrgid(gid);
- if (mygroup==NULL)
- sprintf(group, "%-8ld ", (long)gid);
- else
- strcpy(group, mygroup->gr_name);
+ if (mygroup==NULL) {
+ sprintf(group, "%ld", gid);
+ return NULL;
+ } else {
+ return strcpy(group, mygroup->gr_name);
+ }
}