Skip to content

Commit

Permalink
Remove the redundant code
Browse files Browse the repository at this point in the history
As myvariable is declared as an integer, it is meaningless that putting
u after %d in the format specifier of sscanf for scanning an integer.
This patch removes the u in the format specifier for avoiding
misleading.
  • Loading branch information
NOVBobLee committed Oct 8, 2024
1 parent 2eadbb1 commit 2a04a64
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/hello-sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ static ssize_t myvariable_store(struct kobject *kobj,
struct kobj_attribute *attr, char *buf,
size_t count)
{
sscanf(buf, "%du", &myvariable);
sscanf(buf, "%d", &myvariable);
return count;
}

Expand Down

0 comments on commit 2a04a64

Please sign in to comment.