Revision 3230 libsylph/procheader.c

View differences:

procheader.c
809 809
{
810 810
	gint result;
811 811

  
812
	*zone = '\0';
812 813
	result = sscanf(str, "%10s %d %9s %d %2d:%2d:%2d %5s",
813 814
			weekday, day, month, year, hh, mm, ss, zone);
814
	if (result == 8) return 0;
815
	if (result >= 7) return 0;
815 816

  
816 817
	result = sscanf(str, "%3s,%d %9s %d %2d:%2d:%2d %5s",
817 818
			weekday, day, month, year, hh, mm, ss, zone);
818
	if (result == 8) return 0;
819
	if (result >= 7) return 0;
819 820

  
820 821
	result = sscanf(str, "%3s,%d %9s %d %2d.%2d.%2d %5s",
821 822
			weekday, day, month, year, hh, mm, ss, zone);
822
	if (result == 8) return 0;
823
	if (result >= 7) return 0;
823 824

  
824 825
	result = sscanf(str, "%3s %d, %9s %d %2d:%2d:%2d %5s",
825 826
			weekday, day, month, year, hh, mm, ss, zone);
826
	if (result == 8) return 0;
827
	if (result >= 7) return 0;
827 828

  
828 829
	result = sscanf(str, "%d %9s %d %2d:%2d:%2d %5s",
829 830
			day, month, year, hh, mm, ss, zone);
830
	if (result == 7) return 0;
831
	if (result >= 6) return 0;
831 832

  
832
	*zone = '\0';
833
	result = sscanf(str, "%10s %d %9s %d %2d:%2d:%2d",
834
			weekday, day, month, year, hh, mm, ss);
835
	if (result == 7) return 0;
836

  
837
	result = sscanf(str, "%d %9s %d %2d:%2d:%2d",
838
			day, month, year, hh, mm, ss);
839
	if (result == 6) return 0;
840

  
841 833
	result = sscanf(str, "%d-%2s-%2d %2d:%2d:%2d",
842 834
			year, month, day, hh, mm, ss);
843 835
	if (result == 6) return 0;
......
845 837
	*ss = 0;
846 838
	result = sscanf(str, "%10s %d %9s %d %2d:%2d %5s",
847 839
			weekday, day, month, year, hh, mm, zone);
848
	if (result == 7) return 0;
840
	if (result >= 6) return 0;
849 841

  
850 842
	result = sscanf(str, "%d %9s %d %2d:%2d %5s",
851 843
			day, month, year, hh, mm, zone);
852
	if (result == 6) return 0;
844
	if (result >= 5) return 0;
853 845

  
854
	result = sscanf(str, "%10s %d %9s %d %2d:%2d",
855
			weekday, day, month, year, hh, mm);
856
	if (result == 6) return 0;
857

  
858
	result = sscanf(str, "%d %9s %d %2d:%2d",
859
			day, month, year, hh, mm);
860
	if (result == 5) return 0;
861

  
862 846
	return -1;
863 847
}
864 848

  

Also available in: Unified diff