Skip to content

Commit ce20b35

Browse files
committed
Replaces magic number 2 with BYTESPER_DLWORD in calculation of buffer size.
1 parent c4752e6 commit ce20b35

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/ether_nethub.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ LispPTR ether_get(LispPTR args[])
468468
log_debug(("ether_get() - begin\n"));
469469

470470
target = (u_char *)NativeAligned2FromLAddr(args[1]);
471-
maxByteCount = 2 * LispIntToCInt(args[0]); /* words to bytes */
471+
maxByteCount = BYTESPER_DLWORD * LispIntToCInt(args[0]); /* words to bytes */
472472
log_debug((" target = %p maxBytecount: %d bytes\n", (void *)target, maxByteCount));
473473

474474
ether_buf = target;
@@ -501,7 +501,7 @@ LispPTR ether_send(LispPTR args[])
501501
log_debug(("ether_send() - begin\n"));
502502

503503
u_char *source = (u_char *)NativeAligned2FromLAddr(args[1]);
504-
int byteCount = 2 * LispIntToCInt(args[0]); /* words to bytes */
504+
int byteCount = BYTESPER_DLWORD * LispIntToCInt(args[0]); /* words to bytes */
505505

506506
log_debug((" source = %p , bytecount: %d bytes\n", (void *)source, byteCount));
507507

src/ether_sunos.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ LispPTR ether_get(LispPTR args[])
366366
LispPTR MaxByteCount;
367367
sigset_t signals;
368368

369-
MaxByteCount = 2 * (0xFFFF & args[0]); /* words to bytes */
369+
MaxByteCount = BYTERSPER_DLWORD * (0xFFFF & args[0]); /* words to bytes */
370370

371371
DBPRINT(("Ether Get. "));
372372

@@ -408,7 +408,7 @@ LispPTR ether_send(LispPTR args[])
408408
LispPTR MaxByteCount;
409409
u_char *BufferAddr; /* buffer address pointer(in native address) */
410410

411-
MaxByteCount = 2 * (0xFFFF & args[0]); /* words to bytes */
411+
MaxByteCount = BYTESPER_DLWORD * (0xFFFF & args[0]); /* words to bytes */
412412
BufferAddr = (u_char *)NativeAligned2FromLAddr(args[1]);
413413

414414
if (ether_fd > 0) {

0 commit comments

Comments
 (0)