Patch on unsupported AT command

Marcel Holtmann marcel at holtmann.org
Sun Nov 22 22:21:04 PST 2009


Hi Yang,

looks good so far, but ...

> +static gboolean check_terminator(struct terminator_info *info, char
> *line)
> +{
> +       if ((info->len == -1 && !strcmp(line, info->terminator)) ||
> +               (info->len > 0 && !strncmp(line, info->terminator,
> info->len)))
> +               return TRUE;
> +       else
> +               return FALSE;
> +}
> + 

This is first of all violating the coding style with the indentation on
the second line of the if, but it is also way too complicated.

	if (info->len == -1 && !strcmp(line, info->terminator)
		return TRUE;

	if (info->len > 0 && !strncmp(line, info->terminator, ...))
		return TRUE;

	return FALSE;

Maybe it is too early in the morning to do code review, but this should
be doing the same, but be a lot simpler to read ;)

Regards

Marcel




More information about the ofono mailing list