According to header file, wrong parameters
yield 1 as return value.
Also tried to fix the comments since one part
of it was unreadable.
Signed-off-by: Ola Olsson <ola.olsson@sonymobile.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
float rate;
char *end;
- if (argc != 1) {
- printf("Invalid parameters!\n");
- return 2;
- }
+ if (argc != 1)
+ return 1;
rate = strtod(argv[0], &end);
if (*end != '\0')
const enum command_identify_by idby;
/*
* The handler should return a negative error code,
- * zero on success, 1 if the arguments were wrong
- * and the usage message should and 2 otherwise.
+ * zero on success, 1 if the arguments were wrong.
+ * Return 2 iff you provide the error message yourself.
*/
int (*handler)(struct nl80211_state *state,
struct nl_msg *msg,
{
enum nl80211_ps_state ps_state;
- if (argc != 1) {
- printf("Invalid parameters!\n");
- return 2;
- }
+ if (argc != 1)
+ return 1;
if (strcmp(argv[0], "on") == 0)
ps_state = NL80211_PS_ENABLED;