Rename getline function to unsafe, to make it greppable.
Now i can trim them one-by-one.
This commit is contained in:
@ -64,7 +64,7 @@ char *a_Dpi_rd_dpi_socket_dir(char *dirname)
|
||||
dFree(rcpath);
|
||||
|
||||
if ((dir = fopen(dirname, "r")) != NULL) {
|
||||
sockdir = dGetline(dir);
|
||||
sockdir = dGetline_unsafe(dir);
|
||||
fclose(dir);
|
||||
} else if (errno == ENOENT) {
|
||||
ERRMSG("a_Dpi_rd_dpi_socket_dir", "fopen", errno);
|
||||
|
@ -189,7 +189,7 @@ char *get_dpi_dir(char *dpidrc)
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
while ((rcline = dGetline(In)) != NULL) {
|
||||
while ((rcline = dGetline_unsafe(In)) != NULL) {
|
||||
if (strncmp(rcline, "dpi_dir", 7) == 0)
|
||||
break;
|
||||
dFree(rcline);
|
||||
@ -497,7 +497,7 @@ int fill_services_list(struct dp *attlist, int numdpis, Dlist **services_list)
|
||||
*services_list = dList_new(8);
|
||||
|
||||
/* dpidrc parser loop */
|
||||
for (;(line = dGetline(dpidrc_stream)) != NULL; dFree(line)) {
|
||||
for (;(line = dGetline_unsafe(dpidrc_stream)) != NULL; dFree(line)) {
|
||||
st = dParser_parse_rc_line(&line, &service, &path);
|
||||
if (st < 0) {
|
||||
MSG_ERR("dpid: Syntax error in %s: service=\"%s\" path=\"%s\"\n",
|
||||
|
@ -55,7 +55,7 @@ static int Dpi_read_comm_keys(int *port)
|
||||
fname = dStrconcat(dGethomedir(), "/.flenser/dpid_comm_keys", NULL);
|
||||
if ((In = fopen(fname, "r")) == NULL) {
|
||||
MSG_ERR("[Dpi_read_comm_keys] %s\n", dStrerror(errno));
|
||||
} else if ((rcline = dGetline(In)) == NULL) {
|
||||
} else if ((rcline = dGetline_unsafe(In)) == NULL) {
|
||||
MSG_ERR("[Dpi_read_comm_keys] empty file: %s\n", fname);
|
||||
} else {
|
||||
*port = strtol(rcline, &tail, 10);
|
||||
|
Reference in New Issue
Block a user