aboutsummaryrefslogtreecommitdiff
path: root/dbfp.c
diff options
context:
space:
mode:
Diffstat (limited to 'dbfp.c')
-rw-r--r--dbfp.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/dbfp.c b/dbfp.c
index 5c54a3d..5b0960d 100644
--- a/dbfp.c
+++ b/dbfp.c
@@ -183,9 +183,8 @@ void dbfp_departure_close(struct dbfp_departure *departure)
free(departure->track);
}
-int dbfp_query_departure(struct dbfp *dbfp, struct dbfp_location *location,
- char *location_id, time_t time, size_t *n,
- struct dbfp_departure **departures)
+int dbfp_query_departure(struct dbfp *dbfp, char *location_id, time_t time,
+ size_t *n, struct dbfp_departure **departures)
{
int err = 0;
char *query = 0;
@@ -196,9 +195,7 @@ int dbfp_query_departure(struct dbfp *dbfp, struct dbfp_location *location,
struct parse_data pd = { .error = 0, .data = &dd };
struct tm *tm;
- if (!dbfp || !n || !departures)
- return EINVAL;
- if ((!location && !location_id) || (location && !location->id))
+ if (!dbfp || !location_id || !n || !departures)
return EINVAL;
*n = 0;
@@ -220,11 +217,9 @@ int dbfp_query_departure(struct dbfp *dbfp, struct dbfp_location *location,
goto cleanup;
err = dbfp_format_url(&query, "id=%s&date=%s&time=%s",
- location ? location->id : location_id,
- query_date, query_time);
+ location_id, query_date, query_time);
} else {
- err = dbfp_format_url(&query, "id=%s",
- location ? location->id : location_id);
+ err = dbfp_format_url(&query, "id=%s", location_id);
}
if (err)
goto cleanup;