diff --git a/demo/cmd.c b/demo/cmd.c index 091284d..d40ff80 100644 --- a/demo/cmd.c +++ b/demo/cmd.c @@ -21,6 +21,7 @@ #include #include #include +#include #include "examples.h" #define BUFSZ 10000 @@ -204,7 +205,7 @@ int prepare_cmd_lib(comedi_t *dev,int subdevice,comedi_cmd *cmd) */ int prepare_cmd(comedi_t *dev,int subdevice,comedi_cmd *cmd) { - memset(cmd,0,sizeof(cmd)); + memset(cmd,0,sizeof(*cmd)); /* the subdevice that the command is sent to */ cmd->subdev = subdevice;