From 635ecce5990cc763160bb7e89b9291f09d06afc5 Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Fri, 10 Jun 2016 14:20:19 +0200 Subject: dbfp_query_departure: remove location argument, only use location_id --- dbfp.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'dbfp.c') 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; -- cgit v1.2.1