X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=udev.h;h=904948d67ac92d7df4fa80e27ae7eea6e44fb64d;hb=8f43a65e4f0b545d705cc4cf9f31fa336b0cf8f3;hp=cdf1af4fc21ec58b51d2b25363a5aaebfdd889f1;hpb=9d496c74f3a6b1963727b515126e87e64abe046c;p=elogind.git diff --git a/udev.h b/udev.h index cdf1af4fc..904948d67 100644 --- a/udev.h +++ b/udev.h @@ -70,6 +70,12 @@ struct udevice { mode_t mode; }; +#define strfieldcpy(to, from) \ +do { \ + to[sizeof(to)-1] = '\0'; \ + strncpy(to, from, sizeof(to)-1); \ +} while (0) + extern int udev_add_device(char *path, char *subsystem); extern int udev_remove_device(char *path, char *subsystem);