update to libical cvs on 20050124

This commit is contained in:
mvl%exedo.nl 2005-01-24 22:11:02 +00:00
Родитель c591e8de9c
Коммит 9e3ed09b24
10 изменённых файлов: 57 добавлений и 57 удалений

Просмотреть файл

@ -3,7 +3,7 @@
FILE: icalvalue.c
CREATOR: eric 02 May 1999
$Id: icalderivedvalue.c.in,v 1.11 2002/06/27 00:22:09 acampi Exp $
$Id: icalderivedvalue.c.in,v 1.13 2005/01/24 11:48:01 acampi Exp $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
@ -39,13 +39,8 @@
#include "icalvalueimpl.h"
#include <stdlib.h> /* for malloc */
#include <stdio.h> /* for sprintf */
#include <string.h> /* For memset, others */
#include <stddef.h> /* For offsetof() macro */
#include <errno.h>
#include <time.h> /* for mktime */
#include <stdlib.h> /* for atoi and atof */
#include <limits.h> /* for SHRT_MAX */
struct icalvalue_impl* icalvalue_new_impl(icalvalue_kind kind);

Просмотреть файл

@ -3,7 +3,7 @@
FILE: icaltime.c
CREATOR: eric 02 June 2000
$Id: icalduration.c,v 1.16 2002/10/30 21:22:03 acampi Exp $
$Id: icalduration.c,v 1.18 2005/01/24 11:50:54 acampi Exp $
$Locker: $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
@ -183,14 +183,13 @@ struct icaldurationtype icaldurationtype_from_string(const char* str)
return icaldurationtype_bad_duration();
}
#define TMP_BUF_SIZE 1024
static
void append_duration_segment(char** buf, char** buf_ptr, size_t* buf_size,
char* sep, unsigned int value) {
char temp[TMP_BUF_SIZE];
char temp[32];
sprintf(temp,"%d",value);
snprintf(temp,sizeof(temp),"%d",value);
icalmemory_append_string(buf, buf_ptr, buf_size, temp);
icalmemory_append_string(buf, buf_ptr, buf_size, sep);

Просмотреть файл

@ -4,7 +4,7 @@
CREATOR: eric 26 July 2000
$Id: icalmime.c,v 1.7 2003/05/09 14:30:06 acampi Exp $
$Id: icalmime.c,v 1.8 2005/01/24 12:49:11 acampi Exp $
$Locker: $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
@ -199,7 +199,7 @@ icalcomponent* icalmime_parse(char* (*get_string)(char *s, size_t size,
minor = parts[i].header.minor_text;
}
sprintf(mimetype,"%s/%s",major,minor);
snprintf(mimetype,sizeof(mimetype),"%s/%s",major,minor);
comp = icalcomponent_new(ICAL_XLICMIMEPART_COMPONENT);

Просмотреть файл

@ -3,7 +3,7 @@
FILE: icalparser.c
CREATOR: eric 04 August 1999
$Id: icalparser.c,v 1.47 2004/05/10 22:36:49 acampi Exp $
$Id: icalparser.c,v 1.48 2005/01/24 12:51:37 acampi Exp $
$Locker: $
The contents of this file are subject to the Mozilla Public License
@ -47,7 +47,7 @@
#include "icalcomponent.h"
#include <string.h> /* For strncpy & size_t */
#include <stdio.h> /* For FILE and fgets and sprintf */
#include <stdio.h> /* For FILE and fgets and snprintf */
#include <stdlib.h> /* for free */
#include "icalmemory.h"
@ -931,7 +931,7 @@ icalcomponent* icalparser_add_line(icalparser* parser,
icalproperty_kind prop_kind = icalproperty_isa(prop);
icalcomponent* tail = pvl_data(pvl_tail(parser->components));
sprintf(temp,"Cant parse as %s value in %s property. Removing entire property",
snprintf(temp,sizeof(temp),"Cant parse as %s value in %s property. Removing entire property",
icalvalue_kind_to_string(value_kind),
icalproperty_kind_to_string(prop_kind));
@ -961,7 +961,7 @@ icalcomponent* icalparser_add_line(icalparser* parser,
icalproperty_kind prop_kind = icalproperty_isa(prop);
icalcomponent *tail = pvl_data(pvl_tail(parser->components));
sprintf(temp,"No value for %s property. Removing entire property",
snprintf(temp,sizeof(temp),"No value for %s property. Removing entire property",
icalproperty_kind_to_string(prop_kind));
insert_error(tail, str, temp,

Просмотреть файл

@ -3,7 +3,7 @@
FILE: icalrecur.c
CREATOR: eric 16 May 2000
$Id: icalrecur.c,v 1.60 2004/05/10 22:47:28 acampi Exp $
$Id: icalrecur.c,v 1.62 2005/01/24 13:04:23 acampi Exp $
$Locker: $
@ -537,13 +537,13 @@ char* icalrecurrencetype_as_string(struct icalrecurrencetype *recur)
}
if(recur->count != 0){
sprintf(temp,"%d",recur->count);
snprintf(temp,sizeof(temp),"%d",recur->count);
icalmemory_append_string(&str,&str_p,&buf_sz,";COUNT=");
icalmemory_append_string(&str,&str_p,&buf_sz, temp);
}
if(recur->interval != 0){
sprintf(temp,"%d",recur->interval);
snprintf(temp,sizeof(temp),"%d",recur->interval);
icalmemory_append_string(&str,&str_p,&buf_sz,";INTERVAL=");
icalmemory_append_string(&str,&str_p,&buf_sz, temp);
}
@ -570,12 +570,12 @@ char* icalrecurrencetype_as_string(struct icalrecurrencetype *recur)
if (pos == 0)
icalmemory_append_string(&str,&str_p,&buf_sz,daystr);
else {
sprintf(temp,"%d%s",pos,daystr);
snprintf(temp,sizeof(temp),"%d%s",pos,daystr);
icalmemory_append_string(&str,&str_p,&buf_sz,temp);
}
} else {
sprintf(temp,"%d",array[i]);
snprintf(temp,sizeof(temp),"%d",array[i]);
icalmemory_append_string(&str,&str_p,&buf_sz, temp);
}
@ -589,9 +589,9 @@ char* icalrecurrencetype_as_string(struct icalrecurrencetype *recur)
/* If week start is not monday (the default per RFC2445) append WKST */
if (recur->week_start != ICAL_MONDAY_WEEKDAY) {
sprintf(temp,"%s", icalrecur_weekday_to_string(recur->week_start));
icalmemory_append_string(&str,&str_p,&buf_sz,";WKST=");
icalmemory_append_string(&str,&str_p,&buf_sz, temp);
icalmemory_append_string(&str,&str_p,&buf_sz,
icalrecur_weekday_to_string(recur->week_start));
}
return str;

Просмотреть файл

@ -4,7 +4,7 @@
CREATOR: eric 02 June 2000
$Id: icaltime.h,v 1.24 2003/02/17 14:23:17 acampi Exp $
$Id: icaltime.h,v 1.25 2005/01/24 13:06:10 acampi Exp $
$Locker: $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
@ -204,6 +204,10 @@ int icaltime_day_of_week(const struct icaltimetype t);
given time is within. */
int icaltime_start_doy_of_week(const struct icaltimetype t);
/** Return the day of the year for the first day of the week that the
given time is within. */
int icaltime_start_doy_in_week(const struct icaltimetype t, int fdow);
/** Return the day of the year for the first day of the week that the
given time is within. */
int icaltime_start_doy_week(const struct icaltimetype t, int fdow);

Просмотреть файл

@ -4,7 +4,7 @@
FILE: icalvalue.c
CREATOR: eric 02 May 1999
$Id: icalvalue.c,v 1.37 2003/01/16 01:14:21 acampi Exp $
$Id: icalvalue.c,v 1.40 2005/01/24 13:11:31 acampi Exp $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
@ -39,7 +39,7 @@
#include "icalvalueimpl.h"
#include <stdlib.h> /* for malloc */
#include <stdio.h> /* for sprintf */
#include <stdio.h> /* for snprintf */
#include <string.h> /* For memset, others */
#include <stddef.h> /* For offsetof() macro */
#include <errno.h>
@ -321,7 +321,7 @@ icalvalue* icalvalue_new_from_string_with_error(icalvalue_kind kind,const char*
if (error != 0){
char temp[TMP_BUF_SIZE];
sprintf(temp,"%s Values are not implemented",
snprintf(temp,sizeof(temp),"%s Values are not implemented",
icalvalue_kind_to_string(kind));
*error = icalproperty_vanew_xlicerror(
temp,
@ -416,10 +416,8 @@ icalvalue* icalvalue_new_from_string_with_error(icalvalue_kind kind,const char*
/* HACK */
if (error != 0){
char temp[TMP_BUF_SIZE];
sprintf(temp,"GEO Values are not implemented");
*error = icalproperty_vanew_xlicerror(
temp,
"GEO Values are not implemented",
icalparameter_new_xlicerrortype(
ICAL_XLICERRORTYPE_VALUEPARSEERROR),
0);
@ -646,8 +644,8 @@ static char* icalvalue_binary_as_ical_string(const icalvalue* value) {
data = icalvalue_get_binary(value);
str = (char*)icalmemory_tmp_buffer(60);
sprintf(str,"icalvalue_binary_as_ical_string is not implemented yet");
str = icalmemory_tmp_copy(
"icalvalue_binary_as_ical_string is not implemented yet");
return str;
}
@ -689,9 +687,9 @@ static char* icalvalue_utcoffset_as_ical_string(const icalvalue* value)
s = (data - (h*3600) - (m*60));
if (s > 0)
sprintf(str,"%c%02d%02d%02d",sign,abs(h),abs(m),abs(s));
snprintf(str,9,"%c%02d%02d%02d",sign,abs(h),abs(m),abs(s));
else
sprintf(str,"%c%02d%02d",sign,abs(h),abs(m));
snprintf(str,9,"%c%02d%02d",sign,abs(h),abs(m));
return str;
}
@ -831,9 +829,9 @@ void print_time_to_string(char* str, const struct icaltimetype *data)
char temp[20];
if (icaltime_is_utc(*data)){
sprintf(temp,"%02d%02d%02dZ",data->hour,data->minute,data->second);
snprintf(temp,sizeof(temp),"%02d%02d%02dZ",data->hour,data->minute,data->second);
} else {
sprintf(temp,"%02d%02d%02d",data->hour,data->minute,data->second);
snprintf(temp,sizeof(temp),"%02d%02d%02d",data->hour,data->minute,data->second);
}
strcat(str,temp);
@ -844,7 +842,7 @@ void print_date_to_string(char* str, const struct icaltimetype *data)
{
char temp[20];
sprintf(temp,"%04d%02d%02d",data->year,data->month,data->day);
snprintf(temp,sizeof(temp),"%04d%02d%02d",data->year,data->month,data->day);
strcat(str,temp);
}
@ -898,6 +896,8 @@ static const char* icalvalue_datetime_as_ical_string(const icalvalue* value) {
}
#define MAX_FLOAT_DIGITS 40
static char* icalvalue_float_as_ical_string(const icalvalue* value) {
float data;
@ -905,13 +905,15 @@ static char* icalvalue_float_as_ical_string(const icalvalue* value) {
icalerror_check_arg_rz( (value!=0),"value");
data = icalvalue_get_float(value);
str = (char*)icalmemory_tmp_buffer(15);
str = (char*)icalmemory_tmp_buffer(MAX_FLOAT_DIGITS);
sprintf(str,"%f",data);
snprintf(str,MAX_FLOAT_DIGITS,"%f",data);
return str;
}
#define MAX_GEO_DIGITS 40
static char* icalvalue_geo_as_ical_string(const icalvalue* value) {
struct icalgeotype data;
@ -920,9 +922,9 @@ static char* icalvalue_geo_as_ical_string(const icalvalue* value) {
data = icalvalue_get_geo(value);
str = (char*)icalmemory_tmp_buffer(25);
str = (char*)icalmemory_tmp_buffer(MAX_GEO_DIGITS);
sprintf(str,"%f;%f",data.lat,data.lon);
snprintf(str,MAX_GEO_DIGITS,"%f;%f",data.lat,data.lon);
return str;
}

Просмотреть файл

@ -3,7 +3,7 @@
FILE: sspm.c Parse Mime
CREATOR: eric 25 June 2000
$Id: sspm.c,v 1.8 2003/11/17 22:51:53 gray-john Exp $
$Id: sspm.c,v 1.9 2005/01/24 13:15:19 acampi Exp $
$Locker: $
The contents of this file are subject to the Mozilla Public License
@ -1250,9 +1250,9 @@ void sspm_write_part(struct sspm_buffer *buf,struct sspm_part *part, int *part_n
void sspm_append_hex(struct sspm_buffer* buf, char ch)
{
char tmp[3];
char tmp[4];
sprintf(tmp,"=%02X",ch);
snprintf(tmp,sizeof(tmp),"=%02X",ch);
sspm_append_string(buf,tmp);
}
@ -1481,19 +1481,19 @@ void sspm_write_header(struct sspm_buffer *buf,struct sspm_header *header)
minor = header->minor_text;
}
sprintf(temp,"Content-Type: %s/%s",major,minor);
snprintf(temp,sizeof(temp),"Content-Type: %s/%s",major,minor);
sspm_append_string(buf,temp);
if(header->boundary != 0){
sprintf(temp,";boundary=\"%s\"",header->boundary);
snprintf(temp,sizeof(temp),";boundary=\"%s\"",header->boundary);
sspm_append_string(buf,temp);
}
/* Append any content type parameters */
if(header->content_type_params != 0){
for(i=0; *(header->content_type_params[i])!= 0;i++){
sprintf(temp,header->content_type_params[i]);
snprintf(temp,sizeof(temp),header->content_type_params[i]);
sspm_append_char(buf,';');
sspm_append_string(buf,temp);
}
@ -1505,7 +1505,7 @@ void sspm_write_header(struct sspm_buffer *buf,struct sspm_header *header)
if(header->encoding != SSPM_UNKNOWN_ENCODING &&
header->encoding != SSPM_NO_ENCODING){
sprintf(temp,"Content-Transfer-Encoding: %s\n",
snprintf(temp,sizeof(temp),"Content-Transfer-Encoding: %s\n",
sspm_encoding_string(header->encoding));
}

Просмотреть файл

@ -3,7 +3,7 @@
FILE: icaldirset.c
CREATOR: eric 28 November 1999
$Id: icaldirset.c,v 1.21 2004/05/10 23:06:35 acampi Exp $
$Id: icaldirset.c,v 1.22 2005/01/24 14:00:39 acampi Exp $
$Locker: $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
@ -315,7 +315,7 @@ int icaldirset_next_uid_number(icaldirset* dset)
icalerror_check_arg_rz( (dset!=0), "dset");
sprintf(filename,"%s/%s",dset->dir,"SEQUENCE");
snprintf(filename,sizeof(filename),"%s/%s",dset->dir,"SEQUENCE");
/* Create the file if it does not exist.*/
if (stat(filename,&sbuf) == -1 || !S_ISREG(sbuf.st_mode)){
@ -374,7 +374,7 @@ icalerrorenum icaldirset_next_cluster(icaldirset* dset)
return ICAL_NO_ERROR;
}
sprintf(path,"%s/%s", dset->dir,(char*)pvl_data(dset->directory_iterator));
snprintf(path,sizeof(path),"%s/%s", dset->dir,(char*)pvl_data(dset->directory_iterator));
icalcluster_free(dset->cluster);
dset->cluster = icalfileset_produce_icalcluster(path);
@ -399,9 +399,9 @@ static void icaldirset_add_uid(icalcomponent* comp)
#ifndef WIN32
uname(&unamebuf);
sprintf(uidstring,"%d-%s",(int)getpid(),unamebuf.nodename);
snprintf(uidstring,sizeof(uidstring),"%d-%s",(int)getpid(),unamebuf.nodename);
#else
sprintf(uidstring,"%d-%s",(int)getpid(),"WINDOWS"); /* FIX: There must be an easy get the system name */
snprintf(uidstring,sizeof(uidstring),"%d-%s",(int)getpid(),"WINDOWS"); /* FIX: There must be an easy get the system name */
#endif
uid = icalproperty_new_uid(uidstring);

Просмотреть файл

@ -3,7 +3,7 @@
FILE: icalmessage.c
CREATOR: ebusboom 07 Nov 2000
$Id: icalmessage.c,v 1.5 2002/06/27 02:30:59 acampi Exp $
$Id: icalmessage.c,v 1.7 2005/01/24 14:02:20 acampi Exp $
$Locker: $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
@ -115,7 +115,7 @@ icalcomponent *icalmessage_new_reply_base(icalcomponent* c,
const char* msg)
{
icalproperty *attendee;
char tmp[45];
char tmp[1024];
icalcomponent *reply = icalcomponent_vanew(
ICAL_VCALENDAR_COMPONENT,
@ -159,10 +159,10 @@ icalcomponent *icalmessage_new_reply_base(icalcomponent* c,
icalcomponent_add_property(reply,icalproperty_new_version("2.0"));
#ifndef WIN32
sprintf(tmp,
snprintf(tmp,sizeof(tmp),
"-//SoftwareStudio//NONSGML %s %s //EN",PACKAGE,VERSION);
#else
sprintf(tmp,
snprintf(tmp,sizeof(tmp),
"-//SoftwareStudio//NONSGML %s %s //EN",ICAL_PACKAGE,ICAL_VERSION);
#endif
icalcomponent_add_property(reply,icalproperty_new_prodid(tmp));