kopia lustrzana https://gitlab.com/sane-project/website
73 wiersze
3.0 KiB
HTML
73 wiersze
3.0 KiB
HTML
<!-- received="Tue Mar 30 21:28:25 1999 PST" -->
|
||
<!-- sent="Mon, 29 Mar 1999 05:38:49 +0100 (BST)" -->
|
||
<!-- name="Nick Lamb" -->
|
||
<!-- email="njl98r@ecs.soton.ac.uk" -->
|
||
<!-- subject="Net backend bug [patch]" -->
|
||
<!-- id="" -->
|
||
<!-- inreplyto="" -->
|
||
<title>sane-devel: Net backend bug [patch]</title>
|
||
<h1>Net backend bug [patch]</h1>
|
||
<b>Nick Lamb</b> (<a href="mailto:njl98r@ecs.soton.ac.uk"><i>njl98r@ecs.soton.ac.uk</i></a>)<br>
|
||
<i>Mon, 29 Mar 1999 05:38:49 +0100 (BST)</i>
|
||
<p>
|
||
<ul>
|
||
<li> <b>Messages sorted by:</b> <a href="date.html#252">[ date ]</a><a href="index.html#252">[ thread ]</a><a href="subject.html#252">[ subject ]</a><a href="author.html#252">[ author ]</a>
|
||
<!-- next="start" -->
|
||
<li> <b>Next message:</b> <a href="0253.html">Oliver Rauch: "To Astra 6X0S users!"</a>
|
||
<li> <b>Previous message:</b> <a href="0251.html">Oliver Rauch: "TO UMAX Astra 6X0S users"</a>
|
||
<!-- nextthread="start" -->
|
||
<!-- reply="end" -->
|
||
</ul>
|
||
<!-- body="start" -->
|
||
I think I've found a bug in the net backend.<br>
|
||
It certainly doesn't conform to the current SANE standard (but IMHO the<br>
|
||
current standard document could be tightened up more)<br>
|
||
<p>
|
||
The SANE_TYPE_BUTTON doesn't have a corresponding size. Therefore it is<br>
|
||
wrong of the net backend to insist on doing things with this size, or<br>
|
||
manipulating value at all.<br>
|
||
<p>
|
||
This patch checks for SANE_TYPE_BUTTON, where previously the Net backend<br>
|
||
crashed for me. I cannot tell if this is the only place where the wrong<br>
|
||
assumption about SANE_TYPE_BUTTON is made. But I hope this patch can go<br>
|
||
into a future version of the SANE sample implementation.<br>
|
||
<p>
|
||
Nick.<br>
|
||
<p>
|
||
--- net.c.old Thu Oct 29 07:42:27 1998<br>
|
||
+++ net.c Mon Mar 29 05:13:50 1999<br>
|
||
@@ -697,11 +697,13 @@<br>
|
||
{<br>
|
||
if (info)<br>
|
||
*info = reply.info;<br>
|
||
- if (s->opt.desc[option]->size == reply.value_size)<br>
|
||
- memcpy (value, reply.value, reply.value_size);<br>
|
||
- else<br>
|
||
+ if (s->opt.desc[option]->type == SANE_TYPE_BUTTON)<br>
|
||
+ ; /* Do nothing -- buttons have no value */<br>
|
||
+ else if (s->opt.desc[option]->size != reply.value_size)<br>
|
||
DBG(1, "control_option: size changed from %d to %d\n",<br>
|
||
s->opt.desc[option]->size, reply.value_size);<br>
|
||
+ else<br>
|
||
+ memcpy (value, reply.value, reply.value_size);<br>
|
||
<br>
|
||
if (reply.info & SANE_INFO_RELOAD_OPTIONS)<br>
|
||
s->options_valid = 0;<br>
|
||
<p>
|
||
<p>
|
||
<p>
|
||
<pre>
|
||
--
|
||
Source code, list archive, and docs: <a href="http://www.mostang.com/sane/">http://www.mostang.com/sane/</a>
|
||
To unsubscribe: echo unsubscribe sane-devel | mail <a href="mailto:majordomo@mostang.com">majordomo@mostang.com</a>
|
||
</pre>
|
||
<!-- body="end" -->
|
||
<p>
|
||
<ul>
|
||
<!-- next="start" -->
|
||
<li> <b>Next message:</b> <a href="0253.html">Oliver Rauch: "To Astra 6X0S users!"</a>
|
||
<li> <b>Previous message:</b> <a href="0251.html">Oliver Rauch: "TO UMAX Astra 6X0S users"</a>
|
||
<!-- nextthread="start" -->
|
||
<!-- reply="end" -->
|
||
</ul>
|