Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 367083
b: refs/heads/master
c: c06ca8f
h: refs/heads/master
i:
  367081: 7913cd2
  367079: 9bbf255
v: v3
  • Loading branch information
Dan Carpenter authored and Mauro Carvalho Chehab committed Apr 23, 2013
1 parent 1b2cbdc commit 3170071
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 59501bb792c66b85fb7fdbd740e788e3afc70bbd
refs/heads/master: c06ca8f92b0b23dfd209fea27d71046c9c776910
9 changes: 6 additions & 3 deletions trunk/drivers/media/media-device.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,12 @@ static long media_device_enum_entities(struct media_device *mdev,
return -EINVAL;

u_ent.id = ent->id;
u_ent.name[0] = '\0';
if (ent->name)
strlcpy(u_ent.name, ent->name, sizeof(u_ent.name));
if (ent->name) {
strncpy(u_ent.name, ent->name, sizeof(u_ent.name));
u_ent.name[sizeof(u_ent.name) - 1] = '\0';
} else {
memset(u_ent.name, 0, sizeof(u_ent.name));
}
u_ent.type = ent->type;
u_ent.revision = ent->revision;
u_ent.flags = ent->flags;
Expand Down

0 comments on commit 3170071

Please sign in to comment.