On Tue, 21 Jul 2020 21:38:11 -0700 Matt Ranostay <matt.ranostay@xxxxxxxxxxxx> wrote: > On Tue, Jul 21, 2020 at 11:46 AM Andy Shevchenko > <andy.shevchenko@xxxxxxxxx> wrote: > > > > On Mon, Jul 20, 2020 at 10:05 AM Matt Ranostay > > <matt.ranostay@xxxxxxxxxxxx> wrote: > > > > > > Add support for the Atlas EZO O2 chemical sensor which required > > > some refactoring of the driver and parsing of i2c transfer. > > > > > > Sensor data is converted by the scaling value from percent to > > > IIO_CONCENTRATION. > > > > ... > > > > > +static void atlas_ezo_sanitize(char *buf) > > > +{ > > > + char *ptr = strchr(buf, '.'); > > > + > > > + if (!ptr) > > > + return; > > > + > > > + for (; *ptr; ptr++) > > > + *ptr = *(ptr + 1); > > > +} > > > > NIH of memmove()? Why? > > Mainly since I forgot that POSIX function. I'll fix it up when possible > > - Matt I've dropped the series for now. Lets just have a v3 with these bits tidied up. It will have to wait for the next cycle however as I'll be doing what is probably the last pull for this cycle in a few minutes. Thanks, Jonathan > > > > > And actually to avoid strlen() you may do it other way around, i.e > > shift integer part one character right and return new buffer pointer. > > > > > > if (!ptr) > > return buf; > > > > memmove(buf + 1, buf, ptr - buf); > > return buf + 1; > > > > -- > > With Best Regards, > > Andy Shevchenko