[bugfix] write-string doesn't detect given port
This commit is contained in:
parent
89b2f7bbab
commit
0e464b2f75
12
src/port.c
12
src/port.c
|
@ -316,11 +316,11 @@ pic_port_write_string(pic_state *pic)
|
||||||
|
|
||||||
n = pic_get_args(pic, "s|pii", &str, &len, &port, &start, &end);
|
n = pic_get_args(pic, "s|pii", &str, &len, &port, &start, &end);
|
||||||
switch (n) {
|
switch (n) {
|
||||||
case 2:
|
case 1:
|
||||||
port = pic_stdout(pic);
|
port = pic_stdout(pic);
|
||||||
case 3:
|
case 2:
|
||||||
start = 0;
|
start = 0;
|
||||||
case 4:
|
case 3:
|
||||||
end = len;
|
end = len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -355,11 +355,11 @@ pic_port_write_blob(pic_state *pic)
|
||||||
|
|
||||||
n = pic_get_args(pic, "b|pii", &blob, &port, &start, &end);
|
n = pic_get_args(pic, "b|pii", &blob, &port, &start, &end);
|
||||||
switch (n) {
|
switch (n) {
|
||||||
case 2:
|
case 1:
|
||||||
port = pic_stdout(pic);
|
port = pic_stdout(pic);
|
||||||
case 3:
|
case 2:
|
||||||
start = 0;
|
start = 0;
|
||||||
case 4:
|
case 3:
|
||||||
end = blob->len;
|
end = blob->len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue