Corrected calculation of board name offset. Fixes segmentation violation
authorIan Abbott <abbotti@mev.co.uk>
Fri, 7 Sep 2007 17:04:27 +0000 (17:04 +0000)
committerIan Abbott <abbotti@mev.co.uk>
Fri, 7 Sep 2007 17:04:27 +0000 (17:04 +0000)
when reading /proc/comedi for comedi drivers that have num_names > 1.

comedi/proc.c

index 506d31e8d4698acf0eef2dd17f7366ccc27496da..6723c32c146c98a6acfb5e69c3da790b3042001f 100644 (file)
@@ -74,7 +74,7 @@ int comedi_read_procmem(char *buf,char **start,off_t offset,int len,int *eof,voi
                l += sprintf(buf+l,"%s:\n",driv->driver_name);
                for(i=0;i<driv->num_names;i++){
                        l+=sprintf(buf+l," %s\n",
-                               *(char **)(driv->board_name+i*driv->offset));
+                               *(char **)((char *)driv->board_name+i*driv->offset));
                }
                if(!driv->num_names){
                        l+=sprintf(buf+l," %s\n",driv->driver_name);