VirtualBox

Changeset 2516 in kBuild


Ignore:
Timestamp:
Jul 26, 2011 10:04:11 AM (13 years ago)
Author:
bird
Message:

func_abspathex: Don't crash when no cwd is given. Addressed gcc warnings.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/function.c

    r2495 r2516  
    26832683{
    26842684  const char *in      = argv[0];
    2685   size_t      in_len  = strlen (in);
     2685  math_int    in_len  = (math_int)strlen (in);
    26862686  const char *str     = argv[1];
    2687   size_t      str_len = strlen (str);
     2687  math_int    str_len = (math_int)strlen (str);
    26882688  math_int    n       = 0;
    26892689  math_int    length  = str_len;
     
    28262826{
    28272827  const char *str     = argv[0];
    2828   size_t      str_len = strlen (str);
     2828  math_int    str_len = (math_int)strlen (str);
    28292829  math_int    start   = math_int_from_string (argv[1]);
    28302830  math_int    length  = 0;
     
    36143614  /* cwd needs leading spaces chopped and may be optional,
    36153615     in which case we're exactly like $(abspath ). */
    3616   while (isblank(*cwd))
    3617     cwd++;
    3618   if (!*cwd)
     3616  if (cwd)
     3617    while (isblank (*cwd))
     3618      cwd++;
     3619  if (!cwd || !*cwd)
    36193620    o = func_abspath (o, argv, funcname);
    36203621  else
     
    46564657      else
    46574658        {
    4658           error (NILF, _("bad number: '%s' (base=%d, pos=%d)\n"), start, base, str - start);
     4659          error (NILF, _("bad number: '%s' (base=%u, pos=%lu)\n"), start, base, (unsigned long)(str - start));
    46594660          return 0;
    46604661        }
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette