/[mailutils]/mailutils/mh/mh_ctx.c
ViewVC logotype

Diff of /mailutils/mh/mh_ctx.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by polak, Thu Dec 26 20:51:06 2002 UTC revision 1.4 by gray, Wed Jan 15 17:38:05 2003 UTC
# Line 71  mh_context_read (mh_context_t *ctx) Line 71  mh_context_read (mh_context_t *ctx)
71    fread (blurb, st.st_size, 1, fp);    fread (blurb, st.st_size, 1, fp);
72    fclose (fp);    fclose (fp);
73        
74    if (status = header_create (&ctx->header, blurb, st.st_size, NULL))    if ((status = header_create (&ctx->header, blurb, st.st_size, NULL)) != 0)
75      free (blurb);      free (blurb);
76    
77    return status;    return status;
# Line 111  mh_context_write (mh_context_t *ctx) Line 111  mh_context_write (mh_context_t *ctx)
111     Instead, it should return a const pointer to the static storage within     Instead, it should return a const pointer to the static storage within
112     the header_t structure and be declared as     the header_t structure and be declared as
113     `const char *mh_context_get_value()'. Current implementation of     `const char *mh_context_get_value()'. Current implementation of
114     header_.* functions does not allow that. */     header_.* functions does not allow that.
115    
116       This has two drawbacks:
117         1) The function is declared as returning char * instead of
118            intended const char *.
119         2) Ugly typecast when returning defval. */
120      
121  char *  char *
122  mh_context_get_value (mh_context_t *ctx, const char *name, const char *defval)  mh_context_get_value (mh_context_t *ctx, const char *name, const char *defval)
123  {  {
124    char *p;    char *p;
125    
126    if (header_aget_value (ctx->header, name, &p))    if (header_aget_value (ctx->header, name, &p))
127      p = defval;      p = (char *) defval;
128    return p;    return p;
129  }  }
130    

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26