mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
lib: Rename fgets_slash to x_fgets_slash
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
cd9d957adb
commit
1314db09dd
@ -337,7 +337,7 @@ read a line from a file with possible \ continuation chars.
|
|||||||
Blanks at the start or end of a line are stripped.
|
Blanks at the start or end of a line are stripped.
|
||||||
The string will be allocated if s2 is NULL
|
The string will be allocated if s2 is NULL
|
||||||
**/
|
**/
|
||||||
_PUBLIC_ char *fgets_slash(char *s2,int maxlen,XFILE *f);
|
_PUBLIC_ char *x_fgets_slash(char *s2,int maxlen,XFILE *f);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Read one line (data until next newline or eof) and allocate it
|
* Read one line (data until next newline or eof) and allocate it
|
||||||
|
@ -36,7 +36,7 @@ read a line from a file with possible \ continuation chars.
|
|||||||
Blanks at the start or end of a line are stripped.
|
Blanks at the start or end of a line are stripped.
|
||||||
The string will be allocated if s2 is NULL
|
The string will be allocated if s2 is NULL
|
||||||
**/
|
**/
|
||||||
_PUBLIC_ char *fgets_slash(char *s2,int maxlen,XFILE *f)
|
_PUBLIC_ char *x_fgets_slash(char *s2,int maxlen,XFILE *f)
|
||||||
{
|
{
|
||||||
char *s=s2;
|
char *s=s2;
|
||||||
int len = 0;
|
int len = 0;
|
||||||
@ -97,7 +97,7 @@ _PUBLIC_ char *fgets_slash(char *s2,int maxlen,XFILE *f)
|
|||||||
maxlen *= 2;
|
maxlen *= 2;
|
||||||
t = realloc_p(s, char, maxlen);
|
t = realloc_p(s, char, maxlen);
|
||||||
if (!t) {
|
if (!t) {
|
||||||
DEBUG(0,("fgets_slash: failed to expand buffer!\n"));
|
DBG_ERR("failed to expand buffer!\n");
|
||||||
SAFE_FREE(s);
|
SAFE_FREE(s);
|
||||||
return(NULL);
|
return(NULL);
|
||||||
} else s = t;
|
} else s = t;
|
||||||
|
@ -66,7 +66,7 @@ bool getlmhostsent(TALLOC_CTX *ctx, XFILE *fp, char **pp_name, int *name_type,
|
|||||||
|
|
||||||
*name_type = -1;
|
*name_type = -1;
|
||||||
|
|
||||||
if (!fgets_slash(line,sizeof(line),fp)) {
|
if (!x_fgets_slash(line,sizeof(line),fp)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -361,7 +361,7 @@ bool map_username(TALLOC_CTX *ctx, const char *user_in, char **p_user_out)
|
|||||||
|
|
||||||
DEBUG(4,("Scanning username map %s\n",mapfile));
|
DEBUG(4,("Scanning username map %s\n",mapfile));
|
||||||
|
|
||||||
while((s=fgets_slash(buf,sizeof(buf),f))!=NULL) {
|
while((s=x_fgets_slash(buf,sizeof(buf),f))!=NULL) {
|
||||||
char *unixname = s;
|
char *unixname = s;
|
||||||
char *dosname = strchr_m(unixname,'=');
|
char *dosname = strchr_m(unixname,'=');
|
||||||
char **dosuserlist;
|
char **dosuserlist;
|
||||||
|
@ -262,7 +262,7 @@ static void complete_sync(struct sync_record *s)
|
|||||||
while (!x_feof(f)) {
|
while (!x_feof(f)) {
|
||||||
TALLOC_CTX *frame = NULL;
|
TALLOC_CTX *frame = NULL;
|
||||||
|
|
||||||
if (!fgets_slash(line,sizeof(line),f))
|
if (!x_fgets_slash(line,sizeof(line),f))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
ptr = line;
|
ptr = line;
|
||||||
|
@ -655,7 +655,7 @@ bool initialise_wins(void)
|
|||||||
|
|
||||||
/* Read a line from the wins.dat file. Strips whitespace
|
/* Read a line from the wins.dat file. Strips whitespace
|
||||||
from the beginning and end of the line. */
|
from the beginning and end of the line. */
|
||||||
if (!fgets_slash(line,sizeof(line),fp)) {
|
if (!x_fgets_slash(line,sizeof(line),fp)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ bool aix_cache_reload(struct pcap_cache **_pcache)
|
|||||||
|
|
||||||
iEtat = 0;
|
iEtat = 0;
|
||||||
/* scan qconfig file for searching <printername>: */
|
/* scan qconfig file for searching <printername>: */
|
||||||
for (;(line = fgets_slash(NULL, 1024, pfile)); free(line)) {
|
for (;(line = x_fgets_slash(NULL, 1024, pfile)); free(line)) {
|
||||||
bool ok;
|
bool ok;
|
||||||
|
|
||||||
if (*line == '*' || *line == 0)
|
if (*line == '*' || *line == 0)
|
||||||
|
@ -73,7 +73,8 @@ bool std_pcap_cache_reload(const char *pcap_name, struct pcap_cache **_pcache)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (; (pcap_line = fgets_slash(NULL, 1024, pcap_file)) != NULL; free(pcap_line)) {
|
for (; (pcap_line = x_fgets_slash(NULL, 1024, pcap_file)) != NULL;
|
||||||
|
free(pcap_line)) {
|
||||||
char *name = NULL;
|
char *name = NULL;
|
||||||
char *comment = NULL;
|
char *comment = NULL;
|
||||||
char *p, *q;
|
char *p, *q;
|
||||||
|
Loading…
Reference in New Issue
Block a user