[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
problem report #102
From: |
Dan Nicolaescu |
Subject: |
problem report #102 |
Date: |
Mon, 1 Dec 2008 09:01:33 -0800 (PST) |
CID: 102
Checker: NEGATIVE_RETURNS (help)
File: base/src/emacs/src/editfns.c
Function: Fformat_time_string
Description: Negative constant "-1" was passed to a negative sink.
1678 For example, to produce full ISO 8601 format, use "%Y-%m-%dT%T%z". */)
1679 (format_string, time, universal)
1680 Lisp_Object format_string, time, universal;
1681 {
1682 time_t value;
1683 int size;
1684 struct tm *tm;
At conditional (1): "universal != Qnil" taking true path
1685 int ut = ! NILP (universal);
1686
At conditional (2): "format_string & 7 != 3" taking false path
At conditional (3): "0" taking false path
1687 CHECK_STRING (format_string);
1688
At conditional (4): "lisp_time_argument == 0" taking false path
1689 if (! lisp_time_argument (time, &value, NULL))
1690 error ("Invalid time specification");
1691
1692 format_string = code_convert_string_norecord (format_string,
1693 Vlocale_coding_system,
1);
1694
1695 /* This is probably enough. */
At conditional (5): "((0), (format_string & -8))->size_byte < 0" taking true
path
1696 size = SBYTES (format_string) * 6 + 50;
1697
1698 BLOCK_INPUT;
At conditional (6): "ut != 0" taking true path
1699 tm = ut ? gmtime (&value) : localtime (&value);
At conditional (7): "interrupt_input_blocked == 0" taking true path
At conditional (8): "interrupt_input_pending != 0" taking true path
At conditional (9): "pending_atimers != 0" taking true path
At conditional (10): "0" taking false path
1700 UNBLOCK_INPUT;
At conditional (11): "tm == 0" taking false path
1701 if (! tm)
1702 error ("Specified time is not representable");
1703
1704 synchronize_system_time_locale ();
1705
At conditional (12): "1" taking true path
1706 while (1)
1707 {
1708 char *buf = (char *) alloca (size + 1);
1709 int result;
1710
1711 buf[0] = '\1';
1712 BLOCK_INPUT;
At conditional (13): "((0), (format_string & -8))->size_byte < 0" taking true
path
1713 result = emacs_memftimeu (buf, size, SDATA (format_string),
1714 SBYTES (format_string),
1715 tm, ut);
At conditional (14): "interrupt_input_blocked == 0" taking true path
At conditional (15): "interrupt_input_pending != 0" taking true path
At conditional (16): "pending_atimers != 0" taking true path
At conditional (17): "0" taking false path
1716 UNBLOCK_INPUT;
At conditional (18): "result > 0" taking false path
At conditional (19): "result == 0" taking true path
At conditional (20): "*(buf + 0) == 0" taking false path
1717 if ((result > 0 && result < size) || (result == 0 && buf[0] ==
'\0'))
1718 return code_convert_string_norecord (make_unibyte_string (buf,
result),
1719 Vlocale_coding_system, 0);
1720
1721 /* If buffer was too small, make it bigger and try again. */
1722 BLOCK_INPUT;
Event negative_returns: Negative constant "-1" was passed to a negative sink.
[model]
At conditional (21): "((0), (format_string & -8))->size_byte < 0" taking true
path
1723 result = emacs_memftimeu (NULL, (size_t) -1,
1724 SDATA (format_string),
1725 SBYTES (format_string),
1726 tm, ut);
1727 UNBLOCK_INPUT;
1728 size = result + 1;
1729 }
17
- problem report #102,
Dan Nicolaescu <=