Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for validate (0.17 sec)

  1. src/archive/tar/common.go

    )
    
    // validateSparseEntries reports whether sp is a valid sparse map.
    // It does not matter whether sp represents data fragments or hole fragments.
    func validateSparseEntries(sp []sparseEntry, size int64) bool {
    	// Validate all sparse entries. These are the same checks as performed by
    	// the BSD tar utility.
    	if size < 0 {
    		return false
    	}
    	var pre sparseEntry
    	for _, cur := range sp {
    		switch {
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Mar 15 16:01:50 GMT 2024
    - 24.7K bytes
    - Viewed (2)
  2. src/bufio/scan_test.go

    func TestScanRune(t *testing.T) {
    	for n, test := range scanTests {
    		buf := strings.NewReader(test)
    		s := NewScanner(buf)
    		s.Split(ScanRunes)
    		var i, runeCount int
    		var expect rune
    		// Use a string range loop to validate the sequence of runes.
    		for i, expect = range test {
    			if !s.Scan() {
    				break
    			}
    			runeCount++
    			got, _ := utf8.DecodeRune(s.Bytes())
    			if got != expect {
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Sep 22 16:22:42 GMT 2023
    - 14.3K bytes
    - Viewed (0)
  3. src/archive/zip/reader.go

    	end, baseOffset, err := readDirectoryEnd(rdr, size)
    	if err != nil {
    		return err
    	}
    	r.r = rdr
    	r.baseOffset = baseOffset
    	// Since the number of directory records is not validated, it is not
    	// safe to preallocate r.File without first checking that the specified
    	// number of files is reasonable, since a malformed archive may
    	// indicate it contains up to 1 << 128 - 1 files. Since each file has a
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Oct 13 18:36:46 GMT 2023
    - 27.7K bytes
    - Viewed (0)
  4. src/bufio/scan.go

    	}
    	// Request more data.
    	return 0, nil, nil
    }
    
    // isSpace reports whether the character is a Unicode white space character.
    // We avoid dependency on the unicode package, but check validity of the implementation
    // in the tests.
    func isSpace(r rune) bool {
    	if r <= '\u00FF' {
    		// Obvious ASCII ones: \t through \r plus space. Plus two Latin-1 oddballs.
    		switch r {
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Mon Oct 23 09:06:30 GMT 2023
    - 14.2K bytes
    - Viewed (0)
  5. src/archive/tar/writer.go

    	blk := tw.templateV7Plus(hdr, f.formatString, f.formatOctal)
    	f.formatString(blk.toUSTAR().prefix(), namePrefix)
    	blk.setFormat(FormatUSTAR)
    	if f.err != nil {
    		return f.err // Should never happen since header is validated
    	}
    	return tw.writeRawHeader(blk, hdr.Size, hdr.Typeflag)
    }
    
    func (tw *Writer) writePAXHeader(hdr *Header, paxHdrs map[string]string) error {
    	realName, realSize := hdr.Name, hdr.Size
    
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Oct 13 18:36:46 GMT 2023
    - 19.6K bytes
    - Viewed (0)
  6. src/archive/tar/reader.go

    		key, value, residual, err := parsePAXRecord(sbuf)
    		if err != nil {
    			return nil, ErrHeader
    		}
    		sbuf = residual
    
    		switch key {
    		case paxGNUSparseOffset, paxGNUSparseNumBytes:
    			// Validate sparse header order and value.
    			if (len(sparseMap)%2 == 0 && key != paxGNUSparseOffset) ||
    				(len(sparseMap)%2 == 1 && key != paxGNUSparseNumBytes) ||
    				strings.Contains(value, ",") {
    				return nil, ErrHeader
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Mar 08 01:59:14 GMT 2024
    - 26.8K bytes
    - Viewed (0)
Back to top