Displaying 1 result from an estimated 1 matches for "line_buff".
2003 May 19
0
[PATCH] getpwnam() implementation in tftpd.c
...+ char *pw_dir; /* Home directory. */
+ char *pw_shell; /* Shell program. */
+};
+
+/* to prevent a compiler warning */
+struct passwd *__getpwent(int pwd_fd);
+struct passwd *getpwnam(const char *name);
+
+#define PWD_BUFFER_SIZE 256
+struct passwd *__getpwent(int pwd_fd)
+{
+ static char line_buff[PWD_BUFFER_SIZE];
+ static struct passwd passwd;
+ char *field_begin;
+ char *endptr;
+ char *gid_ptr=NULL;
+ char *uid_ptr=NULL;
+ int line_len;
+ int i;
+
+ /* We use the restart label to handle malformatted lines */
+ restart:
+ /* Read the passwd line into the static buffer using a minimal of...