Branch: refs/heads/master
Home: https://github.com/Starlink/starlink
Commit: 66f524cbd2db128e104a9e917b01da4d651a9755
https://github.com/Starlink/starlink/commit/66f524cbd2db128e104a9e917b01da4d651a9755
Author: Tim Jenness <[log in to unmask]>
Date: 2014-08-28 (Thu, 28 Aug 2014)
Changed paths:
M applications/ccdpack/ccdwish.c
M applications/ccdpack/main/tcltalk.c
Log Message:
-----------
ccdpack: Fix some pointer comparisons
It seems that on my Mac (at least):
if ( ++c >= retbuf + BUFLENG ) {
comes out true even when `c` and `retbuf` differ by 1 with `c`
less than `retbuf`. It looks like this is some issues with
64-bit unsigned types and signed ints. Recasting it explicitly
to use a ptrdiff_t type fixes the problem:
c++;
if ( (ptrdiff_t)(c - retbuf) >= BUFLENG ) {
Before this fix pairndf was failing even before it started with
a buffer overflow in the Tcl communication system.
After this patch pairndf at least throws up a couple of images
although I'm not sure what I'm supposed to do with them once
they are up.
|