X-Git-Url: https://git.kernelconcepts.de/?p=metawatch.git;a=blobdiff_plain;f=metawatch.c;h=a285171c3111b3f07533b3fae7ef4d8695b7be2f;hp=90ea65ea41b09da2b755ca8ce36e79dd195909dd;hb=b13e74e7cef18139e924327e23c39c116507a7a2;hpb=8f684d091fcba89917d5511fd672e6b9542dd028 diff --git a/metawatch.c b/metawatch.c index 90ea65e..a285171 100644 --- a/metawatch.c +++ b/metawatch.c @@ -1,7 +1,20 @@ /* * (c) 2011 Siegen, Germany by Nils Faerber * - * license LGPL + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. */ #include @@ -352,7 +365,7 @@ void mw_send_bitmap(int mw_fd, unsigned char mode, int width, int height, int of unsigned int y, rowlength; unsigned char mw_buf[24]; - rowlength = ((width / 8) + 1); + rowlength = (((width-1) / 8) + 1); if ((height + offset) > 96) height = 96 - offset; @@ -374,7 +387,7 @@ void mw_send_bitmap(int mw_fd, unsigned char mode, int width, int height, int of memset(mw_buf, 0, 24); memcpy(mw_buf, (bmapbuf+(y*rowlength)), (rowlength > 12) ? 12 : rowlength); memcpy((mw_buf+12), (bmapbuf+((y+1)*rowlength)), (rowlength > 12) ? 12 : rowlength); - mw_write_buffer(mw_fd, mode, 0, 31+y, mw_buf, 24); + mw_write_buffer(mw_fd, mode, 0, offset+y, mw_buf, 24); } }