Mercurial > projects > pwm
comparison pwfile.c @ 4:b5c4267a7182
Fix check for successful deletion of a empty group
A return value of NULL means that there is no empty group of that name.
Improve the error message.
author | Guido Berhoerster <guido+pwm@berhoerster.name> |
---|---|
date | Sun, 05 Feb 2017 13:30:31 +0100 |
parents | 1cc98a5677d9 |
children | 0b1bce8db371 |
comparison
equal
deleted
inserted
replaced
3:1cc98a5677d9 | 4:b5c4267a7182 |
---|---|
690 pwfile_remove_group(struct pwm_ctx *ctx, const char *group) | 690 pwfile_remove_group(struct pwm_ctx *ctx, const char *group) |
691 { | 691 { |
692 struct pws3_field *empty_group_field; | 692 struct pws3_field *empty_group_field; |
693 | 693 |
694 empty_group_field = pws3_file_remove_empty_group(ctx->file, group); | 694 empty_group_field = pws3_file_remove_empty_group(ctx->file, group); |
695 if (empty_group_field != NULL) { | 695 if (empty_group_field == NULL) { |
696 return (-1); | 696 return (-1); |
697 } | 697 } |
698 pws3_field_destroy(empty_group_field); | 698 pws3_field_destroy(empty_group_field); |
699 | 699 |
700 return (0); | 700 return (0); |