;;; dns.el --- Domain Name Service lookups
-;; Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+
+;; Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
;; Keywords: network
(decf times step))
(ignore-errors
(delete-process process))
- (when tcp-p
+ (when (and tcp-p
+ (>= (buffer-size) 2))
(goto-char (point-min))
(delete-region (point) (+ (point) 2)))
- (unless (zerop (buffer-size))
+ (when (>= (buffer-size) 2)
(let ((result (dns-read (buffer-string))))
(if fullp
result