/*
** Splint - annotation-assisted static program checker
-** Copyright (C) 1994-2002 University of Virginia,
+** Copyright (C) 1994-2003 University of Virginia,
** Massachusetts Institute of Technology
**
** This program is free software; you can redistribute it and/or modify it
{
lldiagmsg (message ("Cannot get working directory: %s\n",
lldecodeerror (errno)));
+ osd_cwd = cstring_makeLiteral ("<missing directory>");
}
else
{
llassert (cstring_isDefined (cwd2));
llassert (cstring_isDefined (filename));
- abs_buffer = (char *) dmalloc (size_fromInt (cstring_length (cwd2) + cstring_length (filename) + 2));
+ abs_buffer = (char *) dmalloc (cstring_length (cwd2) + cstring_length (filename) + 2);
endp = abs_buffer;
/*
rel_buf_p = rel_buffer;
*rel_buf_p = '\0';
+ if (cwd_p == NULL)
+ {
+ /* Need to prevent recursive assertion failures */
+ return cstring_copy (filename);
+ }
+
llassert (cwd_p != NULL);
llassert (path_p != NULL);
{
/* Give up if the result gets to be longer
than the absolute path name. */
- if (rel_buffer + filename_len <= rel_buf_p + 3)
+ char * temp_rel_buf_p;
+
+ /*drl This comment is necessary because for some reason Splint
+ does not realize that the pasts where rel_buf_p is released
+ do not reach here*/
+ /*@-usereleased@*/
+ temp_rel_buf_p = rel_buf_p;
+ /*@-usereleased@*/
+
+ if (rel_buffer + filename_len <= temp_rel_buf_p + 3)
{
sfree (rel_buffer);
return cstring_copy (filename);